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

fix: unordered mode too many labels issue. #1148

Merged
merged 4 commits into from
Nov 13, 2024
Merged

fix: unordered mode too many labels issue. #1148

merged 4 commits into from
Nov 13, 2024

Conversation

Genesis929
Copy link
Collaborator

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: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Nov 12, 2024
@Genesis929 Genesis929 marked this pull request as ready for review November 12, 2024 21:58
@Genesis929 Genesis929 requested review from a team as code owners November 12, 2024 21:58
@Genesis929 Genesis929 requested a review from GarrettWu November 12, 2024 21:58
@Genesis929 Genesis929 requested a review from shobsi November 12, 2024 22:14

if not self.strictly_ordered:
job_config.labels["bigframes-mode"] = "unordered"

# Note: add_labels is global scope which may have unexpected effects
bq_io.add_labels(job_config, api_name=api_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Highly recommend adding a test using the customer's use case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Nov 12, 2024
@@ -2766,22 +2766,17 @@ def test_series_case_when(scalars_dfs_maybe_ordered):
bf_series = scalars_df["int64_col"]
pd_series = scalars_pandas_df["int64_col"]

# TODO(tswast): pandas case_when appears to assume True when a value is
Copy link
Contributor

@shobsi shobsi Nov 12, 2024

Choose a reason for hiding this comment

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

I would keep this comment, or rather add a dedicated test that clearly conveys the intent - test_series_case_when_with_large_number_of_operations, or even test_series_large_number_of_operations, with comment that describes the labels limit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to have all cases in the original test. Keep only one test can be overall faster I think.

@Genesis929 Genesis929 requested a review from shobsi November 13, 2024 00:37
@Genesis929 Genesis929 merged commit 7216b21 into main Nov 13, 2024
23 checks passed
@Genesis929 Genesis929 deleted the case_when_fix branch November 13, 2024 17:58
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: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants