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

BigQuery API Deprecation Warning #97

Closed
drewmcdonald opened this issue Dec 30, 2021 · 1 comment · Fixed by #98
Closed

BigQuery API Deprecation Warning #97

drewmcdonald opened this issue Dec 30, 2021 · 1 comment · Fixed by #98
Labels
enhancement New feature or request good_first_issue Good for newcomers

Comments

@drewmcdonald
Copy link
Contributor

drewmcdonald commented Dec 30, 2021

Describe the feature

The BigQueryConnectionManager.dataset method is firing a deprecation warning due to its call to bigquery.Client.dataset:

[...]
2021-12-30 18:02:49.877082 (ThreadPoolExecutor-1_9): Client.dataset is deprecated and will be removed in a future version. Use a string like 'my_project.my_dataset' or a cloud.google.bigquery.DatasetReference object, instead.
[...]

From the current API docs:

Client.dataset
Deprecated since version 1.24.0: Construct a DatasetReference using its constructor or use a string where previously a reference object was used.

Suggested Work

Given this and other updates to the BigQuery API, I think it would be healthy to do two things:

  • Simplify BigQueryConnectionManager.dataset to directly create a bigquery.DatasetReference.
    • optionally, rename this method to dataset_ref to be clear about what's being returned
  • Simplify BigQueryConnectionManager.table_ref to directly create a bigquery.TableReference; make it a static method.

With these changes, we can quit passing a conn around just to deliver a reference, and we'll meet (my interpretation of) BQ API best practice by working with unconnected references where possible and deferring 'connected' operations to a client.

Describe alternatives you've considered

  1. do nothing / kick the can down the road on this deprecation
  2. fix only the call triggering the deprecation warning, leave the rest as-is
  3. cry

Additional context

n/a

Who will this benefit?

This will benefit maintainers by simplifying the signatures of two core methods.

Are you interested in contributing this feature?

Put me in, coach!

@drewmcdonald drewmcdonald added enhancement New feature or request triage labels Dec 30, 2021
@McKnight-42 McKnight-42 added good_first_issue Good for newcomers and removed triage labels Jan 5, 2022
@McKnight-42
Copy link
Contributor

@drewmcdonald thank you for pointing this out seems like a fantastic idea and would love to be of any help I can be on this as you work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants