Skip to content

Commit

Permalink
Fix URI
Browse files Browse the repository at this point in the history
  • Loading branch information
sb2nov committed Nov 17, 2015
1 parent 812a6d1 commit 4af64fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dataduct/s3/s3_file.py
@@ -1,11 +1,11 @@
"""
Base class for storing a S3 File
"""
from ..utils.exceptions import ETLInputError
from ..utils.helpers import parse_path
from .s3_path import S3Path
from .utils import upload_to_s3
from .utils import read_from_s3
from ..utils.helpers import parse_path
from ..utils.exceptions import ETLInputError
from .utils import upload_to_s3

DEFAULT_FILE_NAME = 'file'

Expand Down
4 changes: 3 additions & 1 deletion dataduct/steps/create_update_sql.py
Expand Up @@ -38,6 +38,8 @@ def __init__(self,
update_script = SqlScript(filename=parse_path(script))
else:
update_script = SqlScript(command)
sql_script = self.create_script(S3File(text=update_script.sql()))
sql_script.upload_to_s3()

dest = Table(SqlScript(filename=parse_path(table_definition)))

Expand All @@ -46,7 +48,7 @@ def __init__(self,

arguments = [
'--table_definition=%s' % dest.sql().sql(),
'--sql=%s' % self.create_script(S3File(text=update_script))
'--sql=%s' % sql_script.s3_path.uri
]

if analyze_table:
Expand Down
2 changes: 1 addition & 1 deletion dataduct/steps/executors/runner.py
Expand Up @@ -68,7 +68,7 @@ def sql_runner():

sql_query = args.sql
if sql_query.startswith('s3://'):
sql_query = S3File(s3_path=S3Path(uri=args.sql)).text()
sql_query = S3File(s3_path=S3Path(uri=args.sql)).text

table = Table(SqlStatement(args.table_definition))
connection = redshift_connection()
Expand Down

0 comments on commit 4af64fe

Please sign in to comment.