Skip to content

Commit

Permalink
chore: Change all frontend occurances of HogQL to SQL (#28471)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
timgl and github-actions[bot] authored Feb 10, 2025
1 parent 858c0aa commit 2f04b8a
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/trends.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Trends', () => {
.type(
'{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}avg(1042) * 2048'
)
cy.contains('Update HogQL expression').click()
cy.contains('Update SQL expression').click()

cy.get('[data-attr=chart-filter]').click()
cy.contains('Table').click()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function DefinitionView({ group }: { group: TaxonomicFilterGroup }): JSX.Element
label: column.name + ' (' + column.type + ')',
value: column.name,
}))
const hogqlOption = { label: 'HogQL Expression', value: '' }
const hogqlOption = { label: 'SQL Expression', value: '' }
const itemValue = localDefinition ? group?.getValue?.(localDefinition) : null

const isUsingHogQLExpression = (value: string | undefined): boolean => {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/lib/components/HogQLEditor/HogQLEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ export function HogQLEditor({
<pre>
{placeholder ??
(metadataSource && isActorsQuery(metadataSource)
? "Enter HogQL expression, such as:\n- properties.$geoip_country_name\n- toInt(properties.$browser_version) * 10\n- concat(properties.name, ' <', properties.email, '>')\n- is_identified ? 'user' : 'anon'"
: "Enter HogQL Expression, such as:\n- properties.$current_url\n- person.properties.$geoip_country_name\n- pdi.person.properties.email\n- toInt(properties.`Long Field Name`) * 10\n- concat(event, ' ', distinct_id)\n- if(1 < 2, 'small', 'large')")}
? "Enter SQL expression, such as:\n- properties.$geoip_country_name\n- toInt(properties.$browser_version) * 10\n- concat(properties.name, ' <', properties.email, '>')\n- is_identified ? 'user' : 'anon'"
: "Enter SQL Expression, such as:\n- properties.$current_url\n- person.properties.$geoip_country_name\n- pdi.person.properties.email\n- toInt(properties.`Long Field Name`) * 10\n- concat(event, ' ', distinct_id)")}
</pre>
</div>
<LemonButton
className="mt-2"
fullWidth
type="primary"
onClick={() => onChange(bufferedValue)}
disabledReason={!bufferedValue ? 'Please enter a HogQL expression' : null}
disabledReason={!bufferedValue ? 'Please enter a SQL expression' : null}
center
>
{submitText ?? 'Update HogQL expression'}
{submitText ?? 'Update SQL expression'}
</LemonButton>
<div className="flex mt-1 gap-1">
<div className={`w-full text-right select-none ${CLICK_OUTSIDE_BLOCK_CLASS}`}>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/InsightLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function MathTag({ math, mathProperty, mathHogQL, mathGroupTypeIndex }: MathTagP
)
}
if (math === 'hogql') {
return <LemonTag className="max-w-60 text-ellipsis overflow-hidden">{String(mathHogQL) || 'HogQL'}</LemonTag>
return <LemonTag className="max-w-60 text-ellipsis overflow-hidden">{String(mathHogQL) || 'SQL'}</LemonTag>
}
return <LemonTag>{capitalizeFirstLetter(math)}</LemonTag>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export interface InlineHogQLEditorProps {
export function InlineHogQLEditor({ value, onChange, metadataSource }: InlineHogQLEditorProps): JSX.Element {
return (
<>
<div className="taxonomic-group-title">HogQL expression</div>
<div className="taxonomic-group-title">SQL expression</div>
<div className="px-2 pt-2">
<HogQLEditor
onChange={onChange}
value={String(value ?? '')}
metadataSource={metadataSource}
submitText={value ? 'Update HogQL expression' : 'Add HogQL expression'}
submitText={value ? 'Update SQL expression' : 'Add SQL expression'}
disableAutoFocus // :TRICKY: No autofocus here. It's controlled in the TaxonomicFilter.
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/queries/nodes/InsightViz/EditorFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function EditorFilters({ query, showing, embedded }: EditorFiltersProps):
},
hasPathsHogQL && {
key: 'hogql',
label: 'HogQL Expression',
label: 'SQL Expression',
component: PathsHogQL,
},
hasPathsAdvanced && {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/data-warehouse/ViewLinkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function ViewLinkForm(): JSX.Element {
onSelect={selectSourceKey}
value={sourceIsUsingHogQLExpression ? '' : selectedSourceKey ?? undefined}
disabledReason={selectedSourceTableName ? '' : 'Select a table to choose join key'}
options={[...sourceTableKeys, { value: '', label: <span>HogQL Expression</span> }]}
options={[...sourceTableKeys, { value: '', label: <span>SQL Expression</span> }]}
placeholder="Select a key"
/>
{sourceIsUsingHogQLExpression && (
Expand All @@ -142,7 +142,7 @@ export function ViewLinkForm(): JSX.Element {
onSelect={selectJoiningKey}
value={joiningIsUsingHogQLExpression ? '' : selectedJoiningKey ?? undefined}
disabledReason={selectedJoiningTableName ? '' : 'Select a table to choose join key'}
options={[...joiningTableKeys, { value: '', label: <span>HogQL Expression</span> }]}
options={[...joiningTableKeys, { value: '', label: <span>SQL Expression</span> }]}
placeholder="Select a key"
/>
{joiningIsUsingHogQLExpression && (
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/experiments/Metrics/Selectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function FunnelAggregationSelect({
label: `Unique sessions`,
})
optionSections[0].options.push({
label: 'Custom HogQL expression',
label: 'Custom SQL expression',
options: [
{
// This is a bit of a hack so that the HogQL option is only highlighted as active when the user has
Expand All @@ -90,7 +90,7 @@ export function FunnelAggregationSelect({
onChange={onSelect}
value={value}
placeholder={
"Enter HogQL expression, such as:\n- distinct_id\n- properties.$session_id\n- concat(distinct_id, ' ', properties.$session_id)\n- if(1 < 2, 'one', 'two')"
"Enter SQL expression, such as:\n- distinct_id\n- properties.$session_id\n- concat(distinct_id, ' ', properties.$session_id)\n- if(1 < 2, 'one', 'two')"
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function PathsEventsTypes({ insightProps }: EditorFilterProps): JSX.Eleme
},
{
type: PathType.HogQL,
label: 'HogQL expression',
label: 'SQL expression',
selected: includeEventTypes?.includes(PathType.HogQL),
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ function useMathSelectorOptions({
) {
options.push({
value: HogQLMathType.HogQL,
label: 'HogQL expression',
label: 'SQL expression',
tooltip: 'Aggregate events by custom SQL expression.',
'data-attr': `math-node-hogql-expression-${index}`,
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/insights/filters/AggregationSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function AggregationSelect({
label: `Unique sessions`,
})
optionSections[0].options.push({
label: 'Custom HogQL expression',
label: 'Custom SQL expression',
options: [
{
// This is a bit of a hack so that the HogQL option is only highlighted as active when the user has
Expand All @@ -115,7 +115,7 @@ export function AggregationSelect({
onChange={onSelect}
value={value}
placeholder={
"Enter HogQL expression, such as:\n- distinct_id\n- properties.$session_id\n- concat(distinct_id, ' ', properties.$session_id)\n- if(1 < 2, 'one', 'two')"
"Enter SQL expression, such as:\n- distinct_id\n- properties.$session_id\n- concat(distinct_id, ' ', properties.$session_id)\n- if(1 < 2, 'one', 'two')"
}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/insights/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function humanizePathsEventTypes(includeEventTypes: PathsFilter['includeE
humanEventTypes = ['all events']
}
if (includeEventTypes.includes(PathType.HogQL)) {
humanEventTypes.push('HogQL expression')
humanEventTypes.push('SQL expression')
}
}
return humanEventTypes
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/notebooks/Notebook/SlashCommands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const SLASH_COMMANDS: SlashCommandsItem[] = [
),
},
{
title: 'HogQL',
title: 'SQL',
search: 'sql',
icon: <IconHogQL color="currentColor" />,
command: (chain, pos) =>
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/scenes/saved-insights/SavedInsights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,26 +218,26 @@ export const QUERY_TYPES_METADATA: Record<NodeKind, InsightTypeMetadata> = {
inMenu: true,
},
[NodeKind.HogQLQuery]: {
name: 'HogQL',
description: 'Direct HogQL query.',
name: 'SQL',
description: 'Direct SQL query.',
icon: IconBrackets,
inMenu: true,
},
[NodeKind.HogQLASTQuery]: {
name: 'HogQL AST',
description: 'Direct HogQL AST query.',
name: 'SQL AST',
description: 'Direct SQL AST query.',
icon: IconBrackets,
inMenu: false,
},
[NodeKind.HogQLMetadata]: {
name: 'HogQL Metadata',
description: 'Metadata for a HogQL query.',
name: 'SQL Metadata',
description: 'Metadata for a SQL query.',
icon: IconHogQL,
inMenu: true,
},
[NodeKind.HogQLAutocomplete]: {
name: 'HogQL Autocomplete',
description: 'Autocomplete for the HogQL query editor.',
name: 'SQL Autocomplete',
description: 'Autocomplete for the SQL query editor.',
icon: IconHogQL,
inMenu: false,
},
Expand Down Expand Up @@ -336,7 +336,7 @@ export const QUERY_TYPES_METADATA: Record<NodeKind, InsightTypeMetadata> = {
},
[NodeKind.ActorsPropertyTaxonomyQuery]: {
name: 'Actor Property Taxonomy',
description: 'View the taxonomy of the actors property.',
description: "View the taxonomy of the actor's property.",
icon: IconHogQL,
inMenu: false,
},
Expand All @@ -356,7 +356,7 @@ export const INSIGHT_TYPES_METADATA: Record<InsightType, InsightTypeMetadata> =
[InsightType.LIFECYCLE]: QUERY_TYPES_METADATA[NodeKind.LifecycleQuery],
[InsightType.SQL]: {
name: 'SQL',
description: 'Use HogQL to query your data.',
description: 'Use SQL to query your data.',
icon: IconHogQL,
inMenu: true,
},
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/scenes/trends/mathsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ export const PROPERTY_MATH_DEFINITIONS: Record<PropertyMathType, MathDefinition>
}
export const HOGQL_MATH_DEFINITIONS: Record<HogQLMathType, MathDefinition> = {
[HogQLMathType.HogQL]: {
name: 'HogQL expression',
shortName: 'HogQL expression',
description: <>Aggregate with a custom HogQL expression.</>,
name: 'SQL expression',
shortName: 'SQL expression',
description: <>Aggregate with a custom SQL expression.</>,
category: MathCategory.HogQLExpression,
},
}
Expand Down

0 comments on commit 2f04b8a

Please sign in to comment.