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

Update the aggregate API to take a separate group_by #9027

Merged
merged 14 commits into from
Feb 13, 2024

Conversation

jdunkerley
Copy link
Member

@jdunkerley jdunkerley commented Feb 12, 2024

Pull Request Description

Separate out the Group_By from the column definition in aggregate.
image

Supports the old API with a warning attached about deprecation:
image

Widgets have been updated with Group_By removed from the dropdown.

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,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@jdunkerley
Copy link
Member Author

Still to do tests but marking as ready for review so people can comment and look over.

type Validated_Aggregate_Columns
## PRIVATE
Value (key_columns:(Vector Column)) (valid_columns:(Vector (Pair Text Aggregate_Column))) (problems:(Vector Any))
Value (key_columns:(Vector Column)) (valid_columns:(Vector (Pair Text Aggregate_Column))) (problems:(Vector Any)) (old_style:Boolean=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

At this point we might want to start creating tasks to remind us to remove deprecated things at some point in the future.

Base automatically changed from wip/jd/icons-2 to develop February 12, 2024 18:15
@jdunkerley jdunkerley added the CI: Ready to merge This PR is eligible for automatic merge label Feb 13, 2024
@mergify mergify bot merged commit 8c197f3 into develop Feb 13, 2024
27 checks passed
@mergify mergify bot deleted the wip/jd/aggregate-refactor branch February 13, 2024 10:24
if new_columns.is_empty then handle_no_output_columns else
result = self.updated_context_and_columns new_ctx new_columns subquery=True
if validated.old_style.not then result else
Warning.attach (Deprecated.Warning "Standard.Database.Data.Table.Table" "aggregate" "Deprecated: The aggregate API has been altered to take the group_by as a separate vector.") result
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Warning.attach (Deprecated.Warning "Standard.Database.Data.Table.Table" "aggregate" "Deprecated: The aggregate API has been altered to take the group_by as a separate vector.") result
Warning.attach (Deprecated.Warning "Standard.Database.Data.Table.Table" "aggregate" "Deprecated: The aggregate component has been altered to take the group_by as a separate vector. This component should be rebuilt.") result

Is that more GUI user friendly? API sounded unfriendly and it didn't tell the user what they should do.

@@ -240,7 +240,7 @@ raise_duplicated_primary_key_error source_table primary_key original_panic =
False ->
row = materialized.first_row.to_vector
example_count = row.first
example_entry = row.drop 1
example_entry = row.drop (Last 1)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

The count column moved from first to last column due to API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants