-
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
Update the aggregate
API to take a separate group_by
#9027
Conversation
Still to do tests but marking as ready for review so people can comment and look over. |
distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Deprecated.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Deprecated.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
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) |
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.
At this point we might want to start creating tasks to remind us to remove deprecated things at some point in the future.
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Aggregate_Column_Helper.enso
Outdated
Show resolved
Hide resolved
b8a531a
to
db049f0
Compare
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 |
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.
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) |
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.
I don't understand this change.
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.
The count
column moved from first to last column due to API change.
Pull Request Description
Separate out the
Group_By
from the column definition inaggregate
.Supports the old API with a warning attached about deprecation:
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:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.