From f3c65031a1b907ea55f21a27ae7e928a51258236 Mon Sep 17 00:00:00 2001 From: Eugene Miretsky Date: Wed, 13 Apr 2022 17:49:17 -0400 Subject: [PATCH 1/2] upgrade google-api-core to 1.31.5 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 593b0695..a7100faa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,7 +26,7 @@ apache-airflow-providers-facebook==2.1.0 apache-airflow-providers-google==6.3.0 pyopenssl==20.0.1 google-ads==14.0.0 -google-api-core[grpc,grpcgcp]==1.31.3 +google-api-core[grpc,grpcgcp]==1.31.5 google-api-python-client==1.12.8 google-auth-httplib2==0.1.0 google-auth==1.35.0 From ce62f4de16e6378ebdeb8ce39e22adf42841ee0b Mon Sep 17 00:00:00 2001 From: MichailParaskevopoulos Date: Wed, 13 Apr 2022 22:45:51 +0000 Subject: [PATCH 2/2] Formatting fix --- gcp_airflow_foundations/operators/api/hooks/dataform_hook.py | 3 ++- .../operators/api/operators/dataform_operator.py | 2 +- .../operators/api/sensors/dataform_sensor.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gcp_airflow_foundations/operators/api/hooks/dataform_hook.py b/gcp_airflow_foundations/operators/api/hooks/dataform_hook.py index a9f9e728..16b5b10c 100644 --- a/gcp_airflow_foundations/operators/api/hooks/dataform_hook.py +++ b/gcp_airflow_foundations/operators/api/hooks/dataform_hook.py @@ -5,6 +5,7 @@ import requests import json + class DataformHook(BaseHook): ''' Airflow Hook to connect to Dataform's API and run Dataform jobs. @@ -69,4 +70,4 @@ def run_job(self, project_id: str, environment: str, schedule: str, tags: Option def check_job_status(self, run_url: str) -> str: response = requests.get(run_url, headers=self.headers) - return response.json()['status'] \ No newline at end of file + return response.json()['status'] diff --git a/gcp_airflow_foundations/operators/api/operators/dataform_operator.py b/gcp_airflow_foundations/operators/api/operators/dataform_operator.py index dc10395c..7837c656 100644 --- a/gcp_airflow_foundations/operators/api/operators/dataform_operator.py +++ b/gcp_airflow_foundations/operators/api/operators/dataform_operator.py @@ -94,4 +94,4 @@ def execute(self, context) -> str: elif response != 'RUNNING': raise AirflowException(f"Dataform ApiService Error: {response}") else: - time.sleep(self.retry_period_seconds) \ No newline at end of file + time.sleep(self.retry_period_seconds) diff --git a/gcp_airflow_foundations/operators/api/sensors/dataform_sensor.py b/gcp_airflow_foundations/operators/api/sensors/dataform_sensor.py index 9ceb0063..af3b6f1d 100644 --- a/gcp_airflow_foundations/operators/api/sensors/dataform_sensor.py +++ b/gcp_airflow_foundations/operators/api/sensors/dataform_sensor.py @@ -5,6 +5,7 @@ from typing import Any import logging + class DataformSensor(BaseSensorOperator): @apply_defaults def __init__(self, task_ids: str, dataform_conn_id='dataform_conn_id', **kwargs: Any): @@ -23,4 +24,4 @@ def poke(self, context): logging.info(f"Dataform job running. {run_url}") return False else: - raise AirflowException(f"Dataform run {response}: see run logs at {run_url}") \ No newline at end of file + raise AirflowException(f"Dataform run {response}: see run logs at {run_url}")