Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

feat: add manual wrapper for v1beta2 read client#117

Merged
tswast merged 7 commits into
googleapis:masterfrom
tswast:v1beta2-reader
Jan 22, 2021
Merged

feat: add manual wrapper for v1beta2 read client#117
tswast merged 7 commits into
googleapis:masterfrom
tswast:v1beta2-reader

Conversation

@tswast

@tswast tswast commented Jan 14, 2021

Copy link
Copy Markdown
Contributor

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

tswast commented Jan 15, 2021

Copy link
Copy Markdown
Contributor Author

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

tswast commented Jan 15, 2021

Copy link
Copy Markdown
Contributor Author

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

plamut commented Jan 16, 2021

Copy link
Copy Markdown
Contributor

@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

tswast commented Jan 20, 2021

Copy link
Copy Markdown
Contributor Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants