Skip to content

Commit

Permalink
updated empty_file_to_gcs code to work on last google airflow provider
Browse files Browse the repository at this point in the history
  • Loading branch information
pualien committed Jan 14, 2025
1 parent 1a383d6 commit b569ce2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions airflow_add_ons/operators/empty_file_to_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class EmptyFileToGoogleCloudStorageOperator(BaseOperator):
:type google_cloud_storage_conn_id: str
:param mime_type: The mime-type string
:type mime_type: str
:param delegate_to: The account to impersonate, if any
:type delegate_to: str
:param impersonation_chain: The account to impersonate, if any
:type impersonation_chain: str
:param gzip: Allows for file to be compressed and uploaded as gzip
:type gzip: bool
"""
Expand All @@ -32,7 +32,7 @@ def __init__(self,
src='',
gcp_conn_id='google_cloud_default',
mime_type='application/octet-stream',
delegate_to=None,
impersonation_chain=None,
gzip=False,
*args,
**kwargs):
Expand All @@ -42,7 +42,7 @@ def __init__(self,
self.bucket = bucket
self.gcp_conn_id = gcp_conn_id
self.mime_type = mime_type
self.delegate_to = delegate_to
self.impersonation_chain = impersonation_chain
self.gzip = gzip

def execute(self, context):
Expand All @@ -51,7 +51,7 @@ def execute(self, context):
"""
hook = GoogleCloudStorageHook(
gcp_conn_id=self.gcp_conn_id,
delegate_to=self.delegate_to)
impersonation_chain=self.impersonation_chain)

with tempfile.NamedTemporaryFile('w', suffix=self.src) as temp:
hook.upload(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def reqs(*f):


setup(name='airflow-add-ons',
version='0.2.14',
version='0.2.15',
url='https://github.com/pualien/airflow-add-ons',
license='MIT',
author='Matteo Senardi',
Expand Down

0 comments on commit b569ce2

Please sign in to comment.