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

gcs_to_bigquery using deprecated methods #10288

Closed
chenmic opened this issue Aug 11, 2020 · 11 comments · Fixed by #20119
Closed

gcs_to_bigquery using deprecated methods #10288

chenmic opened this issue Aug 11, 2020 · 11 comments · Fixed by #20119
Labels
area:providers good first issue kind:bug This is a clearly a bug provider:google Google (including GCP) related issues

Comments

@chenmic
Copy link

chenmic commented Aug 11, 2020

Hello,
I'm running Airflow 1.10.10 and using the GCSToBigQueryOperator from airflow.providers.google.cloud.transfers.gcs_to_bigquery in order to load data from google cloud storage into a big query table.
Although everything is working as expected, I keep seeing (a lot of) deprecation warnings in my logs:

DeprecationWarning: The bigquery_conn_id parameter has been deprecated. You should pass the gcp_conn_id parameter.
bigquery.py:103: DeprecationWarning: This method will be deprecated. Please use `BigQueryHook.get_client` method`
taskinstance.py:984: DeprecationWarning: This method is deprecated. Please use airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.run_load`
bigquery.py:1614: DeprecationWarning: This method is deprecated. Please use `BigQueryHook.insert_job` method.

Although everything is working well, I'm afraid that in the future those warnings will indeed cause problems.
Please update the code and find a way to use the suggested methods instead of the deprecated ones.
If any more information is needed from me regarding the warnings or my system I will be happy to add it.
Thank you!

@chenmic chenmic added the kind:bug This is a clearly a bug label Aug 11, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 11, 2020

Thanks for opening your first issue here! Be sure to follow the issue template!

@turbaszek turbaszek added area:providers provider:google Google (including GCP) related issues and removed kind:bug This is a clearly a bug labels Aug 11, 2020
@turbaszek
Copy link
Member

Thanks for the issue @chenmic ! I think same goes for other BQ transfer operators as they were not refactored to use new methods.

@coopergillan
Copy link
Contributor

Is this one anything of a priority?

@mik-laj
Copy link
Member

mik-laj commented Aug 11, 2020

This is a P4 level ticket. However, it is worth fixing this problem.

"P1" means Critical Impact – Service Unusable in Production
"P2" means High Impact – Service Use Severely Impaired
"P3" means Medium Impact – Service Use Partially Impaired
"P4" means Low Impact – Service Fully Usable

@coopergillan
Copy link
Contributor

@mik-laj - I'm happy to take it as a P4. Plenty else to work on, but I can grab it when time allows.

@mik-laj
Copy link
Member

mik-laj commented Aug 11, 2020

@coopergillan I assigned you to this ticket.

@aprettyloner
Copy link

aprettyloner commented Aug 26, 2021

My team is also seeing the deprecation warning for decorator in gcs_to_bigquery on all GCSToBigQueryOperator imports. This is noisy and is misleading some of our developers to think we need to make a code change.

/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py:31 DeprecationWarning: This decorator is deprecated.

In previous versions, all subclasses of BaseOperator must use apply_default decorator for the`default_args` feature to work properly.

In current version, it is optional. The decorator is applied automatically using the metaclass.

@eladkal
Copy link
Contributor

eladkal commented Aug 26, 2021

@aprettyloner are you willing to submit a PR to fix it?

@aprettyloner
Copy link

@aprettyloner are you willing to submit a PR to fix it?

Absolutely. Pretty tied in up migrating our DAGs from 1.10 to 2.1 (plus training new hires) but I am happy to open this once things settle down. I'll check on this issue status to ensure not duplicating work when the time comes. Thanks @eladkal

@eladkal
Copy link
Contributor

eladkal commented Nov 30, 2021

@aprettyloner ping :)

@kazanzhy
Copy link
Contributor

kazanzhy commented Dec 7, 2021

Hi all. @chenmic @aprettyloner
I've tried to remove warnings during GCSToBigQueryOperator as in PR #20119
But as a result, I copied almost all code from bq_hook.create_external_table and bq_hook.run_load which made the operator's execute method very sophisticated.
That's why I just switched from cursor method calls to BigQueryHook methods. In my opinion, these methods should not be deprecated.
We need someplace for complex dict creation, like configuration for bq_hook.insert_job() or table_recource for bq_hook.create_empty_table().
In my opinion, better to keep this code in BigQueryHook and don't move to Operator. But maybe I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers good first issue kind:bug This is a clearly a bug provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants