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

Allow BigQuery TableIds to have space in between #22167

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

dgdheeraj
Copy link
Contributor

For Issue #21878
io.Bigquery rejects valid tableIds if they contain spaces.:

However these are allowed by the BigQuery API:
https://cloud.google.com/bigquery/docs/tables#table_naming

If tableId includes hyphens, causes this error

ValueError: Expected a table reference (PROJECT:DATASET.TABLE or DATASET.TABLE) instead of project.dataset.table-id

FIX:
The regex is modified to allow spaces only in between the word and not allow trailing/leading spaces


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

It's my first attempt contributing to beam.
Please do let me know if there are any further changes/issues with the PR
@pabloem
@kennknowles
@robertwb

@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #22167 (930ad5e) into master (b53b16f) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #22167      +/-   ##
==========================================
- Coverage   74.22%   74.20%   -0.02%     
==========================================
  Files         702      702              
  Lines       92829    92830       +1     
==========================================
- Hits        68904    68887      -17     
- Misses      22658    22676      +18     
  Partials     1267     1267              
Flag Coverage Δ
python 83.59% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/python/apache_beam/io/gcp/bigquery.py 70.07% <ø> (ø)
sdks/python/apache_beam/io/gcp/bigquery_tools.py 85.67% <100.00%> (+0.01%) ⬆️
.../python/apache_beam/testing/test_stream_service.py 88.09% <0.00%> (-4.77%) ⬇️
sdks/python/apache_beam/utils/interactive_utils.py 95.12% <0.00%> (-2.44%) ⬇️
sdks/python/apache_beam/io/source_test_utils.py 88.01% <0.00%> (-1.39%) ⬇️
...che_beam/runners/interactive/interactive_runner.py 90.06% <0.00%> (-1.33%) ⬇️
sdks/python/apache_beam/io/localfilesystem.py 90.97% <0.00%> (-0.76%) ⬇️
...eam/runners/portability/fn_api_runner/execution.py 92.44% <0.00%> (-0.65%) ⬇️
sdks/python/apache_beam/runners/direct/executor.py 96.46% <0.00%> (-0.55%) ⬇️
...ks/python/apache_beam/runners/worker/sdk_worker.py 88.94% <0.00%> (-0.16%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b53b16f...930ad5e. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @pabloem for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@robertwb robertwb left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good.

Technically \s is broader than Zs, but I don't see a good way to make that distinction with Python's re module, and false positives here are preferable to false negatives.

@dgdheeraj
Copy link
Contributor Author

Thanks, this looks good.

Technically \s is broader than Zs, but I don't see a good way to make that distinction with Python's re module, and false positives here are preferable to false negatives.

Thanks for the review!
Yeah, I couldn't find up with a better way to include Zs apart from \s

@tvalentyn tvalentyn merged commit da84804 into apache:master Jul 11, 2022
@tvalentyn
Copy link
Contributor

Thanks, @dgdheeraj !

konstantinurysov pushed a commit to akvelon/beam that referenced this pull request Jul 14, 2022
* Updated Regex and test

* Updated Regex and test
lostluck pushed a commit to lostluck/beam that referenced this pull request Aug 26, 2022
* Updated Regex and test

* Updated Regex and test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants