stiak commented on code in PR #37736: URL: https://github.com/apache/airflow/pull/37736#discussion_r1515232407
########## airflow/providers/google/cloud/operators/bigquery.py: ########## @@ -2768,11 +2771,26 @@ def prepare_template(self) -> None: with open(self.configuration) as file: self.configuration = json.loads(file.read()) + def _add_job_labels(self) -> None: + dag_label = self.dag_id.lower() + task_label = self.task_id.lower() + + if LABEL_REGEX.match(dag_label) and LABEL_REGEX.match(task_label): + automatic_labels = {"airflow-dag": dag_label, "airflow-task": task_label} + if "labels" in self.configuration: + if isinstance(self.configuration["labels"], dict): Review Comment: Yep, this makes the conditions more explicit and concise, thanks! -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org