You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pankajastro (via GitHub)" <gi...@apache.org> on 2023/02/24 19:31:07 UTC

[GitHub] [airflow] pankajastro commented on a diff in pull request #29735: Add deferrable mode to BigQueryTablePartitionExistenceSensor.

pankajastro commented on code in PR #29735:
URL: https://github.com/apache/airflow/pull/29735#discussion_r1116641473


##########
airflow/providers/google/cloud/sensors/bigquery.py:
##########
@@ -244,3 +247,69 @@ def execute_complete(self, context: dict[str, Any], event: dict[str, str] | None
                 return event["message"]
             raise AirflowException(event["message"])
         raise AirflowException("No event received in trigger callback")
+
+
+class BigQueryTableExistencePartitionAsyncSensor(BigQueryTablePartitionExistenceSensor):
+    """
+    Checks for the existence of a partition within a table in Google BigQuery.
+
+    :param project_id: The Google cloud project in which to look for the table.
+       The connection supplied to the hook must provide
+       access to the specified project.
+    :param dataset_id: The name of the dataset in which to look for the table.
+       storage bucket.
+    :param partition_id: The name of the partition to check the existence of.
+    :param table_id: The name of the table to check the existence of.
+    :param gcp_conn_id: The connection ID used to connect to Google Cloud.
+    :param bigquery_conn_id: (Deprecated) The connection ID used to connect to Google Cloud.
+       This parameter has been deprecated. You should pass the gcp_conn_id parameter instead.
+    :param delegate_to: The account to impersonate using domain-wide delegation of authority,

Review Comment:
   `delegate_to` has been deprecated so shall we avoid this adding here considering this is a new feature?



##########
airflow/providers/google/cloud/sensors/bigquery.py:
##########
@@ -244,3 +247,69 @@ def execute_complete(self, context: dict[str, Any], event: dict[str, str] | None
                 return event["message"]
             raise AirflowException(event["message"])
         raise AirflowException("No event received in trigger callback")
+
+
+class BigQueryTableExistencePartitionAsyncSensor(BigQueryTablePartitionExistenceSensor):
+    """
+    Checks for the existence of a partition within a table in Google BigQuery.
+
+    :param project_id: The Google cloud project in which to look for the table.
+       The connection supplied to the hook must provide
+       access to the specified project.
+    :param dataset_id: The name of the dataset in which to look for the table.
+       storage bucket.
+    :param partition_id: The name of the partition to check the existence of.
+    :param table_id: The name of the table to check the existence of.
+    :param gcp_conn_id: The connection ID used to connect to Google Cloud.
+    :param bigquery_conn_id: (Deprecated) The connection ID used to connect to Google Cloud.
+       This parameter has been deprecated. You should pass the gcp_conn_id parameter instead.
+    :param delegate_to: The account to impersonate using domain-wide delegation of authority,
+       if any. For this to work, the service account making the request must have
+       domain-wide delegation enabled.
+    :param impersonation_chain: Optional service account to impersonate using short-term
+       credentials, or chained list of accounts required to get the access_token
+       of the last account in the list, which will be impersonated in the request.
+       If set as a string, the account must grant the originating account
+       the Service Account Token Creator IAM role.
+       If set as a sequence, the identities from the list must grant
+       Service Account Token Creator IAM role to the directly preceding identity, with first
+       account from the list granting this role to the originating account (templated).
+    :param polling_interval_seconds: The interval in seconds to wait between checks table existence.

Review Comment:
   sensors expose `poke_interval ` can we reuse that here?



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org