Skip to content

Commit

Permalink
Update the python argument for formula()
Browse files Browse the repository at this point in the history
  • Loading branch information
lbooker42 committed Nov 12, 2024
1 parent 103db51 commit 2d5ba12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions py/client/pydeephaven/agg.py
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
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

0 comments on commit 2d5ba12

Please sign in to comment.