Skip to content

Commit

Permalink
[#270] fixed code style
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksandr-d committed Aug 16, 2018
1 parent 349011c commit c28b613
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions legion_airflow/legion_airflow/hooks/s3_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, conn_id: str, *args, **kwargs):

def _get_uri(self, bucket, key):
"""
Creates an URI based on passed bucket, key and Airflow configuration.
Create an URI based on passed bucket, key and Airflow configuration.
:param bucket: S3 Bucket name
:param key: Path inside S3 bucket
:return: URI, that contains protocol, bucket, path, e.g. s3://bucket/k1/k2/k3_file
Expand Down Expand Up @@ -239,7 +239,6 @@ def load_file(self, filename, key, bucket_name=None, replace=False, encrypt=Fals
by S3 and will be stored in an encrypted form while at rest in S3.
:type encrypt: bool
"""

with self.open_file(bucket_name, key, 'w') as dist:
with open(filename, 'r') as source:
for line in source:
Expand Down Expand Up @@ -268,7 +267,6 @@ def load_string(self, string_data, key, bucket_name=None, replace=False,
:param encoding: String encoding
:type encoding: str
"""

with self.open_file(bucket_name, key, 'w', encoding) as out:
out.write(string_data)

Expand All @@ -292,7 +290,6 @@ def read_key(self, key, bucket_name=None):
:param bucket_name: Name of the bucket in which the file is stored
:type bucket_name: str
"""

if self.exists(bucket_name, key):
with self.open_file(bucket_name, key, 'r', 'utf-8') as out:
return out.read()
Expand Down

0 comments on commit c28b613

Please sign in to comment.