Skip to content

Conversation

TrevorBergeron
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Aug 28, 2025
@TrevorBergeron TrevorBergeron marked this pull request as ready for review August 28, 2025 19:11
@TrevorBergeron TrevorBergeron requested review from a team as code owners August 28, 2025 19:11
@@ -353,6 +354,36 @@ def _(self, op: ops.ScalarOp, input: pl.Expr) -> pl.Expr:
assert isinstance(op, json_ops.JSONDecode)
return input.str.json_decode(_DTYPE_MAPPING[op.to_type])

@compile_op.register(arr_ops.ToArrayOp)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have any engine or system tests for these two new ops?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly, relying on existing aggregate axis=1 tests, though have now added some engine tests for the new ops

@@ -699,6 +699,9 @@ def visit_ArrayFilter(self, op, *, arg, body, param):
def visit_ArrayMap(self, op, *, arg, body, param):
return self.f.array(sg.select(body).from_(self._unnest(arg, as_=param)))

def visit_ArrayReduce(self, op, *, arg, body, param):
return sg.select(body).from_(self._unnest(arg, as_=param)).subquery()
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use self.f.array(...) rather than subquery() similar as other visit_Array* methods in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those other methods output an array, arrayreduce produces a single scalar for each input array, so I don't think we want self.f.array() here

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for checking!

@GarrettWu GarrettWu removed their assignment Aug 28, 2025
@TrevorBergeron TrevorBergeron merged commit fbb2094 into main Aug 28, 2025
20 of 25 checks passed
@TrevorBergeron TrevorBergeron deleted the horizontal_agg branch August 28, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants