Skip to content

fix: Fix bug converting non-string labels to sql ids #296

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 6 commits into from
Jan 4, 2024

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 Dec 28, 2023
@TrevorBergeron TrevorBergeron marked this pull request as ready for review January 2, 2024 18:36
@TrevorBergeron TrevorBergeron requested review from a team as code owners January 2, 2024 18:37
@TrevorBergeron TrevorBergeron requested a review from shobsi January 2, 2024 18:37
return col_ids, idx_ids


def label_to_identifier(label: typing.Hashable, strict: bool = False) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to have unit tests on these utils methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since utils are not part of the public API, I would prefer to test them via the public APIs that use them. I tried to include some unusual labels in the test cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, let's add these two kinds of labels to test the strict mode:

  1. Leading spaces followed by alpha-numeric
  2. Leading spaces followed by _

return col_ids, idx_ids


def label_to_identifier(label: typing.Hashable, strict: bool = False) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, let's add these two kinds of labels to test the strict mode:

  1. Leading spaces followed by alpha-numeric
  2. Leading spaces followed by _

@TrevorBergeron TrevorBergeron added the automerge Merge the pull request once unit tests and other checks pass. label Jan 4, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit a61c5fe into main Jan 4, 2024
@gcf-merge-on-green gcf-merge-on-green bot deleted the multifix branch January 4, 2024 21:14
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jan 4, 2024
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.

2 participants