-
Notifications
You must be signed in to change notification settings - Fork 323
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
Filter drilldown for mixed column #11694
base: develop
Are you sure you want to change the base?
Conversation
🧪 Storybook is successfully deployed!📊 Dashboard:
|
} | ||
if (columnType === 'Date_Time') { | ||
return (item: string) => Ast.parseExpression(`(Date_Time.parse '${item}')`)! | ||
} | ||
if (columnType == 'Mixed') { | ||
return (item: string, module: Ast.MutableModule) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is complex. I would:
- Divide it into two steps--first call a function that categorizes the data, then transform it according to category.
- Add unit tests for value categorization.
} | ||
if (columnType === 'Time') { | ||
return createDateTimePattern('(Time_Of_Day.new __ __ __ __ __ __)', 6) | ||
return (item: string) => Ast.parseExpression(`(Time_Of_Day.parse '${item}')`)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would break if the input contains '
, or any character that is special inside an Enso interpolated string. Maybe AG-Grid would never provide such data, but we don't need to rely on that--TextLiteral.new
handles escaping. In general, Ast.parseExpression
is for when we have an arbitrary input and don't have any expectations about the shape of the output; when we know what kind of expression we want, using a constructor for the expected AST type or a Pattern
avoids all kinds of syntax hazards.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.