Skip to content

Commit

Permalink
Fix to use luigi.contrib for s3.
Browse files Browse the repository at this point in the history
From luigi 2.7.0, luigi.s3 was moved to luigi.contrib.s3.
https://github.com/spotify/luigi/releases/tag/2.6.0
spotify/luigi#2181
  • Loading branch information
saku committed May 14, 2018
1 parent 98f4e6c commit 1960884
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions luigi_td/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import shutil
import time
import luigi
import luigi.s3
import luigi.contrib.s3
import tdclient

from six.moves.urllib.parse import urlparse
Expand Down Expand Up @@ -211,7 +211,7 @@ def get_path(self):
if isinstance(target, luigi.LocalTarget):
return os.path.abspath(target.path)
# S3Target
if isinstance(target, luigi.s3.S3Target):
if isinstance(target, luigi.contrib.s3.S3Target):
url = urlparse(target.path)
return "s3://{aws_access_key_id}:{aws_secret_access_key}@/{bucket}{path}".format(
aws_access_key_id = target.fs.s3.aws_access_key_id,
Expand Down
4 changes: 2 additions & 2 deletions luigi_td/test_bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ def requires(self):
def test_s3_path(self):
class TestInput(luigi.ExternalTask):
def output(self):
s3client = luigi.s3.S3Client(aws_access_key_id='test-key', aws_secret_access_key='test-secret')
return luigi.s3.S3Target('s3://test-bucket/test_input.tsv', client=s3client)
s3client = luigi.contrib.s3.S3Client(aws_access_key_id='test-key', aws_secret_access_key='test-secret')
return luigi.contrib.s3.S3Target('s3://test-bucket/test_input.tsv', client=s3client)
class TestBulkImportFromS3Target(TestBulkImport):
def requires(self):
return TestInput()
Expand Down

0 comments on commit 1960884

Please sign in to comment.