Skip to content

Commit

Permalink
Merge pull request #80 from badal-io/feature/upgrade-google-api-core
Browse files Browse the repository at this point in the history
upgrade google-api-core to 1.31.5
  • Loading branch information
MichailParaskevopoulos authored Apr 13, 2022
2 parents 103e9d0 + ce62f4d commit cb81031
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion gcp_airflow_foundations/operators/api/hooks/dataform_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import requests
import json


class DataformHook(BaseHook):
'''
Airflow Hook to connect to Dataform's API and run Dataform jobs.
Expand Down Expand Up @@ -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']
return response.json()['status']
Original file line number Diff line number Diff line change
Expand Up @@ -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)
time.sleep(self.retry_period_seconds)
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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}")
raise AirflowException(f"Dataform run {response}: see run logs at {run_url}")
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb81031

Please # to comment.