Skip to content

Commit

Permalink
Close/Flush byte stream in s3 hook load_string and load_bytes (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
feluelle authored Jun 15, 2020
1 parent 8b0073d commit a80cd25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions airflow/providers/amazon/aws/hooks/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ def load_string(self,
bytes_data = string_data.encode(encoding)
file_obj = io.BytesIO(bytes_data)
self._upload_file_obj(file_obj, key, bucket_name, replace, encrypt, acl_policy)
file_obj.close()

@provide_bucket_name
@unify_bucket_name_and_key
Expand Down Expand Up @@ -548,6 +549,7 @@ def load_bytes(self,
"""
file_obj = io.BytesIO(bytes_data)
self._upload_file_obj(file_obj, key, bucket_name, replace, encrypt, acl_policy)
file_obj.close()

@provide_bucket_name
@unify_bucket_name_and_key
Expand Down

0 comments on commit a80cd25

Please sign in to comment.