Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hogql): dateAdd should be date_add #23131

Merged
merged 4 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/lib/monaco/hogql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export const language: languages.IMonarchLanguage = {
'age',
'dateDiff',
'dateTrunc',
'dateAdd',
'date_add',
'dateSub',
'timeStampAdd',
'timeStampSub',
Expand Down
2 changes: 1 addition & 1 deletion posthog/hogql/functions/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def compare_types(arg_types: list[ConstantType], sig_arg_types: tuple[ConstantTy
"age": HogQLFunctionMeta("age", 3, 3),
"dateDiff": HogQLFunctionMeta("dateDiff", 3, 3),
"dateTrunc": HogQLFunctionMeta("dateTrunc", 2, 2),
"dateAdd": HogQLFunctionMeta("dateAdd", 3, 3),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dateAdd is an alias if date_add - so I don't see why this wouldn't work. docs. I'd be keen to not change this if we can help it, it'll become one of the only funcs in snake case, and may break existing queries

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

"date_add": HogQLFunctionMeta("date_add", 2, 2),
"dateSub": HogQLFunctionMeta("dateSub", 3, 3),
"timeStampAdd": HogQLFunctionMeta("timeStampAdd", 2, 2),
"timeStampSub": HogQLFunctionMeta("timeStampSub", 2, 2),
Expand Down
Loading