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

feat!: Add multi-column support to AggFormula #6206

Merged
merged 24 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6e248ee
Trying to get python to work.
lbooker42 Oct 14, 2024
33c39ee
Refactored formula aggregation and specifications.
lbooker42 Oct 16, 2024
07d8cf6
Added add'l agg_by test.
lbooker42 Oct 16, 2024
4e7011b
WIP, more work on GRPC.
lbooker42 Oct 16, 2024
dd0e936
Fixing some tests.
lbooker42 Oct 16, 2024
043654d
Fixing some tests.
lbooker42 Oct 17, 2024
03d4bf6
Fixing some tests.
lbooker42 Oct 18, 2024
fa6a456
Merge branch 'main' into lab-agg-multi-formula
lbooker42 Oct 18, 2024
a13ac00
Refactored to use SelectColumn.
lbooker42 Oct 21, 2024
a625c33
Minor cleanup.
lbooker42 Oct 21, 2024
e566029
Self-review, GRPC client tests now passing.
lbooker42 Oct 31, 2024
e0caf7f
Addressed some PR comments.
lbooker42 Nov 7, 2024
a025323
Added tests for correct propagation of MCS for AggFormula
lbooker42 Nov 7, 2024
a4e320a
Merged with main.
lbooker42 Nov 7, 2024
da008ce
Fix agg.py imports.
lbooker42 Nov 7, 2024
81923de
PR comments addressed.
lbooker42 Nov 11, 2024
bf997d5
More comments addressed and TODO added.
lbooker42 Nov 11, 2024
68719b5
Reworked table.proto to add Selectable and adjust Formula to use it.
lbooker42 Nov 11, 2024
103db51
Better Selectable handling for GRPC aggregations.
lbooker42 Nov 12, 2024
2d5ba12
Update the python argument for formula()
lbooker42 Nov 12, 2024
cc8f58c
Provide key column values as scalars to AggFormula.
lbooker42 Nov 12, 2024
22b2364
Addressed PR comments.
lbooker42 Nov 15, 2024
aec23c8
Broken build fix.
lbooker42 Nov 18, 2024
f040167
Correct agg test to remove wavg()
lbooker42 Nov 18, 2024
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
8 changes: 4 additions & 4 deletions py/client/pydeephaven/agg.py
lbooker42 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def first(cols: Union[str, List[str]] = None) -> Aggregation:
return _AggregationColumns(agg_spec=agg_spec, cols=to_list(cols))


def formula(formula: str, formula_param: Optional[str] = None, cols: Union[str, List[str]] = None) -> Aggregation:
def formula(formula: str, formula_param: Optional[str] = None, cols: Optional[Union[str, List[str]]] = None) -> Aggregation:
"""Creates a user defined formula aggregation. This formula can contain a combination of any of the following:
| Built-in functions such as `min`, `max`, etc.
| Mathematical arithmetic such as `*`, `+`, `/`, etc.
Expand All @@ -203,9 +203,9 @@ def formula(formula: str, formula_param: Optional[str] = None, cols: Union[str,
formula_param (Optional[str]): If provided, supplies the parameter name for the input column's vector within the
formula. If formula is `max(each)`, then `each` should be the formula_param. This must be set to None (the
default when omitted) when the `formula`argument specifies the input and output columns.
cols (Union[str, List[str]]): If provided, supplies the column(s) to aggregate on, can be renaming expressions,
i.e. "new_col = col". This must be set to None (the default when omitted) when the `formula`argument
specifies the input and output columns.
cols (Optional[Union[str, List[str]]]): If provided, supplies the column(s) to aggregate on, can be renaming
lbooker42 marked this conversation as resolved.
Show resolved Hide resolved
expressions, i.e. "new_col = col". This must be set to None (the default when omitted) when the `formula`
argument specifies the input and output columns.

Returns:
an aggregation
Expand Down
8 changes: 4 additions & 4 deletions py/server/deephaven/agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def first(cols: Union[str, List[str]] = None) -> Aggregation:
return Aggregation(j_agg_spec=_JAggSpec.first(), cols=cols)


def formula(formula: str, formula_param: Optional[str] = None, cols: Union[str, List[str]] = None) -> Aggregation:
def formula(formula: str, formula_param: Optional[str] = None, cols: Optional[Union[str, List[str]]] = None) -> Aggregation:
"""Creates a user defined formula aggregation. This formula can contain a combination of any of the following:
| Built-in functions such as `min`, `max`, etc.
| Mathematical arithmetic such as `*`, `+`, `/`, etc.
Expand All @@ -180,9 +180,9 @@ def formula(formula: str, formula_param: Optional[str] = None, cols: Union[str,
formula_param (Optional[str]): If provided, supplies the parameter name for the input column's vector within the
formula. If formula is `max(each)`, then `each` should be the formula_param. This must be set to None (the
default when omitted) when the `formula`argument specifies the input and output columns.
cols (Union[str, List[str]]): If provided, supplies the column(s) to aggregate on, can be renaming expressions,
i.e. "new_col = col". This must be set to None (the default when omitted) when the `formula`argument
specifies the input and output columns.
cols (Optional[Union[str, List[str]]]): If provided, supplies the column(s) to aggregate on, can be renaming
expressions, i.e. "new_col = col". This must be set to None (the default when omitted) when the `formula`
argument specifies the input and output columns.

Returns:
an aggregation
Expand Down