Kamran-imaz commented on code in PR #59866:
URL: https://github.com/apache/airflow/pull/59866#discussion_r2657434672
##########
providers/google/src/airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -1089,17 +1090,21 @@ def generate_query(self, hook: BigQueryHook) -> str:
)
return query
- def execute(self, context: Context):
- if self.project_id:
- self.log.warning(
- "The project_id parameter is deprecated, and will be removed
in a future release."
- " Please use table_project_id instead.",
- )
- if not self.table_project_id:
- self.table_project_id = self.project_id
- else:
- self.log.info("Ignoring 'project_id' parameter, as
'table_project_id' is found.")
+ """Deprecated method to assign project_id to table_project_id."""
+ @deprecated(
+ planned_removal_date="June 30, 2026",
+ use_instead="table_project_id",
+ category=AirflowProviderDeprecationWarning,
+ )
+ def _assign_project_id(self, project_id: str) -> str:
+ return project_id
+
+ def execute(self, context: Context):
+ if self.project_id != PROVIDE_PROJECT_ID and not self.table_project_id:
+ self.table_project_id = self._assign_project_id(self.project_id)
+ elif self.project_id != PROVIDE_PROJECT_ID and self.table_project_id:
+ self.log.info("The 'project_id' parameter is deprecated. Please
use 'table_project_id' instead.")
Review Comment:
Thanks for pointing this out, @MaksYermak. I’ll update it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]