You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/09/10 18:41:30 UTC

[airflow] branch main updated: Simplify to bool(...) (#34258)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new c5ec7cd294 Simplify  to bool(...) (#34258)
c5ec7cd294 is described below

commit c5ec7cd294ed9363817b358765ed2a250ae76b6d
Author: Pankaj Koti <pa...@gmail.com>
AuthorDate: Mon Sep 11 00:11:23 2023 +0530

    Simplify  to bool(...) (#34258)
---
 airflow/providers/amazon/aws/sensors/s3.py          | 2 +-
 airflow/providers/google/cloud/triggers/bigquery.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/providers/amazon/aws/sensors/s3.py b/airflow/providers/amazon/aws/sensors/s3.py
index d517709e27..da974f473d 100644
--- a/airflow/providers/amazon/aws/sensors/s3.py
+++ b/airflow/providers/amazon/aws/sensors/s3.py
@@ -157,7 +157,7 @@ class S3KeySensor(BaseSensorOperator):
                 aws_conn_id=self.aws_conn_id,
                 verify=self.verify,
                 poke_interval=self.poke_interval,
-                should_check_fn=True if self.check_fn else False,
+                should_check_fn=bool(self.check_fn),
             ),
             method_name="execute_complete",
         )
diff --git a/airflow/providers/google/cloud/triggers/bigquery.py b/airflow/providers/google/cloud/triggers/bigquery.py
index 5bd9cc8385..2ccb20c59e 100644
--- a/airflow/providers/google/cloud/triggers/bigquery.py
+++ b/airflow/providers/google/cloud/triggers/bigquery.py
@@ -543,7 +543,7 @@ class BigQueryTableExistenceTrigger(BaseTrigger):
                     dataset=dataset, table_id=table_id, project_id=project_id, session=session
                 )
                 response = await client.get()
-                return True if response else False
+                return bool(response)
             except ClientResponseError as err:
                 if err.status == 404:
                     return False