Skip to content

Commit

Permalink
chore(insights): Making schema conversion from schema.ts to schema.py…
Browse files Browse the repository at this point in the history
… include everything in schema.ts (#18075)

* Convert all of schema.ts to schema.py

* Add explicit name to schema root

* Fix test
  • Loading branch information
robbie-c authored Oct 19, 2023
1 parent b124588 commit 4699850
Show file tree
Hide file tree
Showing 20 changed files with 912 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ import {
import { Resizeable } from 'lib/components/Cards/CardMeta'
import { Query } from '~/queries/Query/Query'
import { QueriesUnsupportedHere } from 'lib/components/Cards/InsightCard/QueriesUnsupportedHere'
import { InsightQueryNode, QueryContext } from '~/queries/schema'
import { InsightQueryNode } from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import { InsightMeta } from './InsightMeta'
import { dataNodeLogic, DataNodeLogicProps } from '~/queries/nodes/DataNode/dataNodeLogic'
import { filtersToQueryNode } from '~/queries/nodes/InsightQuery/utils/filtersToQueryNode'
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/queries/Query/Query.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import {
isDataNode,
isDataTableNode,
isSavedInsightNode,
isInsightVizNode,
isSavedInsightNode,
isTimeToSeeDataSessionsNode,
} from '../utils'
import { DataTable } from '~/queries/nodes/DataTable/DataTable'
import { DataNode } from '~/queries/nodes/DataNode/DataNode'
import { InsightViz } from '~/queries/nodes/InsightViz/InsightViz'
import { AnyResponseType, Node, QueryContext, QuerySchema } from '~/queries/schema'
import { AnyResponseType, Node, QuerySchema } from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import { ErrorBoundary } from '~/layout/ErrorBoundary'
import { useEffect, useState } from 'react'
import { TimeToSeeData } from '../nodes/TimeToSeeData/TimeToSeeData'
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/queries/QueryEditor/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { queryEditorLogic } from '~/queries/QueryEditor/queryEditorLogic'
import { AutoSizer } from 'react-virtualized/dist/es/AutoSizer'
import clsx from 'clsx'
import { QueryContext } from '~/queries/schema'
import { QueryContext } from '~/queries/types'
import { CodeEditor } from 'lib/components/CodeEditors'

export interface QueryEditorProps {
query: string
setQuery?: (query: string) => void
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/queries/nodes/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import {
HogQLQuery,
PersonsNode,
PersonsQuery,
QueryContext,
} from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import { useCallback, useState } from 'react'
import { BindLogic, useValues } from 'kea'
import { dataNodeLogic, DataNodeLogicProps } from '~/queries/nodes/DataNode/dataNodeLogic'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/queries/nodes/DataTable/dataTableLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
EventsQuery,
HogQLExpression,
NodeKind,
QueryContext,
TimeToSeeDataSessionsQuery,
} from '~/queries/schema'
import { QueryContext } from '~/queries/types'
import { getColumnsForQuery, removeExpressionComment } from './utils'
import { objectsEqual, sortedKeys } from 'lib/utils'
import { isDataTableNode, isEventsQuery } from '~/queries/utils'
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/queries/nodes/DataTable/renderColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { TZLabel } from 'lib/components/TZLabel'
import { Property } from 'lib/components/Property'
import { urls } from 'scenes/urls'
import { PersonDisplay } from 'scenes/persons/PersonDisplay'
import { DataTableNode, EventsQueryPersonColumn, HasPropertiesNode, QueryContext } from '~/queries/schema'
import { DataTableNode, EventsQueryPersonColumn, HasPropertiesNode } from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import {
isEventsQuery,
isHogQLQuery,
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/queries/nodes/DataTable/renderColumnMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { PropertyFilterType } from '~/types'
import { PropertyKeyInfo } from 'lib/components/PropertyKeyInfo'
import { QueryContext, DataTableNode, EventsQuery } from '~/queries/schema'
import { DataTableNode, EventsQuery } from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import { isHogQLQuery, trimQuotes } from '~/queries/utils'
import { extractExpressionComment } from '~/queries/nodes/DataTable/utils'
import { SortingIndicator } from 'lib/lemon-ui/LemonTable/sorting'
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/queries/nodes/InsightViz/InsightContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic'
import { insightDataLogic } from 'scenes/insights/insightDataLogic'
import { insightNavLogic } from 'scenes/insights/InsightNav/insightNavLogic'

import { QueryContext } from '~/queries/schema'
import { ChartDisplayType, FunnelVizType, ExporterFormat, InsightType, ItemMode } from '~/types'
import { QueryContext } from '~/queries/types'
import { ChartDisplayType, ExporterFormat, FunnelVizType, InsightType, ItemMode } from '~/types'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { Animation } from 'lib/components/Animation/Animation'
import { AnimationType } from 'lib/animations/animations'
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/queries/nodes/InsightViz/InsightViz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { insightSceneLogic } from 'scenes/insights/insightSceneLogic'
import { isFunnelsQuery } from '~/queries/utils'

import { dataNodeLogic, DataNodeLogicProps } from '../DataNode/dataNodeLogic'
import { InsightVizNode, QueryContext } from '../../schema'
import { InsightVizNode } from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import { InsightContainer } from './InsightContainer'
import { EditorFilters } from './EditorFilters'
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/queries/nodes/SavedInsight/SavedInsight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { useValues } from 'kea'

import { insightLogic } from 'scenes/insights/insightLogic'
import { Query } from '~/queries/Query/Query'
import { SavedInsightNode, QueryContext } from '~/queries/schema'
import { SavedInsightNode } from '~/queries/schema'
import { QueryContext } from '~/queries/types'

import { InsightLogicProps } from '~/types'
import { Animation } from 'lib/components/Animation/Animation'
import { AnimationType } from 'lib/animations/animations'
Expand Down
Loading

0 comments on commit 4699850

Please sign in to comment.