Skip to content

refactor: simplify ArrayValue public interface #82

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

Merged
merged 9 commits into from
Oct 5, 2023

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> 🦕

@TrevorBergeron TrevorBergeron requested review from a team as code owners October 3, 2023 00:45
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Oct 3, 2023
@TrevorBergeron TrevorBergeron force-pushed the arrayvaluefactor branch 2 times, most recently from 55a7e52 to 454ff45 Compare October 3, 2023 01:00
@TrevorBergeron TrevorBergeron requested a review from tswast October 3, 2023 17:38
table = self._to_ibis_expr(
ordering_mode="order_by", expose_hidden_cols=True, fraction=fraction
)
table = self._to_ibis_expr(expose_hidden_cols=True, fraction=fraction)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we know why we were using order_by mode before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it was added mistakenly. "ORDER BY" clauses shouldn't be added at this level.

@@ -624,7 +606,7 @@ def corr_aggregate(
Arguments:
corr_aggregations: left_column_id, right_column_id, output_column_id tuples
"""
table = self._to_ibis_expr(ordering_mode="unordered")
table = self._to_ibis_expr()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I worry about default ordering_mode. Since behavior varies so much across modes, I don't know that there's really an intuitive default. I'd prefer we be explicit.

if sorted:
sql = textwrap.dedent(
f"""
SELECT * EXCEPT ({offsets_id})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's wrap this in backticks in case we use spaces or some other characters in the column name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

table = self._to_ibis_expr(expose_hidden_cols=expose_extra_columns)
sql = self._session.ibis_client.compile(table) # type:ignore

# DO NOT COMMIT: Make this ordered
Copy link
Collaborator

Choose a reason for hiding this comment

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

Leftover TODO???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@TrevorBergeron TrevorBergeron merged commit ff3bb89 into main Oct 5, 2023
@TrevorBergeron TrevorBergeron deleted the arrayvaluefactor branch October 5, 2023 20:19
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: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants