Skip to content

Commit

Permalink
HOTFIX: Fixed nargs parsing in submit script
Browse files Browse the repository at this point in the history
  • Loading branch information
ksbg committed Jun 22, 2018
1 parent 5936e03 commit 59be7d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='sparklanes',
version='0.2.2',
version='0.2.3',
url='https://github.com/ksbg/sparklanes',
project_urls={
'sparklanes documentation': 'https://sparklanes.readthedocs.io/',
Expand Down
8 changes: 7 additions & 1 deletion sparklanes/_submit/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def _parse_and_validate_args(args):
----------
args (List): Command-line arguments
"""
class ExtendAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
if getattr(namespace, self.dest, None) is None:
setattr(namespace, self.dest, [])
getattr(namespace, self.dest).extend(values)

parser = argparse.ArgumentParser(description='Submitting a lane to spark.')
parser.add_argument('-y', '--yaml', type=str, required=True,
help='Path to the yaml definition file.')
Expand All @@ -64,7 +70,7 @@ def _parse_and_validate_args(args):
parser.add_argument('-r', '--requirements', type=str, required=False,
help='Path to a `requirements.txt` specifying any additional dependencies '
'of your tasks.')
parser.add_argument('-e', '--extra-data', nargs='*', required=False,
parser.add_argument('-e', '--extra-data', nargs='*', required=False, action=ExtendAction,
help='Path to any additional files or directories that should be packaged '
'and sent to Spark.')
parser.add_argument('-m', '--main', type=str, required=False,
Expand Down

0 comments on commit 59be7d9

Please sign in to comment.