Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hailctl] Expand username in dataproc submit #13805

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion hail/python/hailtop/hailctl/dataproc/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ def submit(
):
print("Submitting to cluster '{}'...".format(name))

if ',' in files:
files_list = files.split(',')
files_list = [os.path.expanduser(file) for file in files_list]
files = ','.join(files_list)

# If you only provide one (comma-sep) argument, and it's a zip file, use that file directly
if not (pyfiles and pyfiles.endswith('.zip') and ',' not in pyfiles):
pyfiles_list = []
Expand All @@ -29,7 +34,8 @@ def submit(
if pyfiles_list:
tfile = tempfile.mkstemp(suffix='.zip', prefix='pyscripts_')[1]
with zipfile.ZipFile(tfile, 'w', zipfile.ZIP_DEFLATED) as zipf:
for hail_script_entry in pyfiles_list:
for _hail_script_entry in pyfiles_list:
hail_script_entry = os.path.expanduser(_hail_script_entry)
if hail_script_entry.endswith('.py'):
zipf.write(hail_script_entry, arcname=os.path.basename(hail_script_entry))
else:
Expand Down