-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: use correct line endings and s3 uris on windows #4118
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -860,7 +860,7 @@ def _prepare_and_upload_runtime_scripts( | |
) | ||
shutil.copy2(spark_script_path, bootstrap_scripts) | ||
|
||
with open(entrypoint_script_path, "w") as file: | ||
with open(entrypoint_script_path, "w", newline="\n") as file: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this change backwards compatible? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it ensures the line endings on the Currently, it's not an issue if submitting remote functions from mac or linux. But submitting them from windows, the script gets written out with Side note: windows users run across the line endings on |
||
file.writelines(entry_point_script) | ||
|
||
bootstrap_script_path = os.path.join( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to understand more about this shortcoming, if this was researched already?
We may need to add this in MergeChecklist for contributors to be aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, windows users run across this with s3 related tooling every so often. The
os.sep
on windows is\\
which doesn't play nice with s3. Not the first time we've run run in to it, other tools make the same misstep.When testing the changes to the line endings, we had to change how the s3 uris are constructed to get it making the correct objects on s3 from windows. Python can handle
/
paths for windows filesystems nicely. But s3 will make an object with\
in the object name instead of a prefix.The tests were also failing on windows since they expect
/
in the assertions. But were getting\\
.I can add that if you like? Or separate issue/PR to do a search over the sdk for this pattern and correct them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'l take a note of this to our team and drive the required changes. Thanks for the explanation.