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

feat: add manual wrapper for v1beta2 read client #117

Merged
merged 7 commits into from Jan 22, 2021

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Jan 14, 2021

We got a bit lucky in that the reader module doesn't create any proto objects, so it could be reused without modification from the "v1" endpoint. Maybe we should be defining these in a shared module that doesn't include the version information, though?

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:

  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@tswast tswast requested review from a team and stephaniewang526 and removed request for a team January 14, 2021 17:28
@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/python-bigquery-storage API. label Jan 14, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 14, 2021
@tswast tswast requested review from shollyman and steffnay and removed request for stephaniewang526 January 14, 2021 17:28
@tswast
Copy link
Contributor Author

tswast commented Jan 15, 2021

Kokoro failure:

    def test_snapshot(client, project_id, table_with_data_ref, bq_client):
>       before_new_data = types.Timestamp()
E       AttributeError: module 'google.cloud.bigquery_storage_v1beta2.types' has no attribute 'Timestamp'

I think there's a manual synth.py config for adding these types from the core protobuf. Will need to add before merging this PR.

@tswast
Copy link
Contributor Author

tswast commented Jan 15, 2021

Re: AttributeError: module 'google.cloud.bigquery_storage_v1beta2.types' has no attribute 'Timestamp', the v1 API has a handwritten module https://github.com/googleapis/python-bigquery-storage/blob/master/google/cloud/bigquery_storage_v1/gapic_types.py which adds these.

@plamut Was this just for backwards compatibility? I imagine I could use the protobuf/proto-plus well-known type logic here instead.

@plamut
Copy link
Contributor

plamut commented Jan 16, 2021

@tswast Since I was not that familiar with this library and short on time, I think I included these generated types like that to avoid import errors and unblock the microgenerator transition. I didn't explore if there exist dedicated synth settings for the proto-plus types, but instead simply adjusted the existing logic for injecting the (old) protos.

@tswast
Copy link
Contributor Author

tswast commented Jan 20, 2021

This is ready for review. I used some parameterized test fixtures to keep from duplicating code in the system tests. Next, I'll start looking more closely at what needs to be done for the write client.

@tswast tswast requested a review from plamut January 22, 2021 20:18
@tswast tswast merged commit 798cd34 into googleapis:master Jan 22, 2021
@tswast tswast deleted the v1beta2-reader branch January 22, 2021 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerystorage Issues related to the googleapis/python-bigquery-storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants