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 26ee186ec5156..99e7f26d16c44 100644 --- a/setup.py +++ b/setup.py @@ -370,6 +370,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