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

Filter drilldown for mixed column #11694

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

marthasharkey
Copy link
Contributor

@marthasharkey marthasharkey commented Nov 28, 2024

date-drilldown-date-time-mixed
filter-drilldown-mixed

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

Copy link

github-actions bot commented Nov 28, 2024

🧪 Storybook is successfully deployed!

📊 Dashboard:

@marthasharkey marthasharkey changed the title Wip/mk/mixed filter dilldown Filter drilldown for mixed column Nov 28, 2024
@marthasharkey marthasharkey marked this pull request as ready for review November 28, 2024 10:53
}
if (columnType === 'Date_Time') {
return (item: string) => Ast.parseExpression(`(Date_Time.parse '${item}')`)!
}
if (columnType == 'Mixed') {
return (item: string, module: Ast.MutableModule) => {
Copy link
Contributor

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}')`)!
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants