From fedab9d64a58f1b5d3c88fe7a67f1f4021db8d26 Mon Sep 17 00:00:00 2001 From: henriqueribeiro Date: Wed, 1 Jun 2022 10:38:41 +0100 Subject: [PATCH] Remove hack from BigQuery DTS hook (#23887) --- airflow/providers/google/cloud/hooks/bigquery_dts.py | 5 +---- setup.py | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/airflow/providers/google/cloud/hooks/bigquery_dts.py b/airflow/providers/google/cloud/hooks/bigquery_dts.py index 9b5892e1b18e7..5a842189cb1d7 100644 --- a/airflow/providers/google/cloud/hooks/bigquery_dts.py +++ b/airflow/providers/google/cloud/hooks/bigquery_dts.py @@ -82,10 +82,7 @@ def _disable_auto_scheduling(config: Union[dict, TransferConfig]) -> TransferCon schedule_options["disable_auto_scheduling"] = True else: new_config["schedule_options"] = {"disable_auto_scheduling": True} - # HACK: TransferConfig.to_dict returns invalid representation - # See: https://github.com/googleapis/python-bigquery-datatransfer/issues/90 - if isinstance(new_config.get('user_id'), str): - new_config['user_id'] = int(new_config['user_id']) + return TransferConfig(**new_config) def get_conn(self) -> DataTransferServiceClient: diff --git a/setup.py b/setup.py index e73a88d6e7d8e..7ce5e61e1a785 100644 --- a/setup.py +++ b/setup.py @@ -367,6 +367,9 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version 'pandas-gbq', pandas_requirement, 'sqlalchemy-bigquery>=1.2.1', + # A transient dependency of google-cloud-bigquery-datatransfer, but we + # further constrain it since older versions are buggy. + 'proto-plus>=1.19.6', ] grpc = [ # Google has very clear rules on what dependencies should be used. All the limits below