-
Notifications
You must be signed in to change notification settings - Fork 248
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
Allow os.PathLike paths for Batch.write_output() #14770
base: main
Are you sure you want to change the base?
Conversation
Extends PR hail-is#14544 which did this for read_input()/read_input_group(). Refactor type coercion previously added to _new_input_resource_file() into a new hailtop.utils.path_str() utility routine, and also invoke it from Batch.write_output().
Change DescriptionFor your consideration… As previously with PR #14544 for b.write_output(j.output_file, str(output_file_path)) Periodically we accidentally omit the str(…), which leads to a semi-obscure error message and an extra editing round-trip:
There is a point of view that Security AssessmentDelete all except the correct answer:
Impact DescriptionFor none/low impact: a quick one/two sentence justification of the rating.
(Reviewers: please confirm the security impact before approving) |
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.
Nice little change, thanks!
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.
Thanks @jmarshall!
@jmarshall Hope you don't mind that I've moved your security impact text into the issue description and re-rated from "no" to "low". And added a justification for that low rating. Hope that looks good? I'll also have a look and see why the tests are unhappy |
@jmarshall the tests are failing at a static analysis step:
|
Static analysis issue fixed; it detected a minor (real) mistake. Because you use GitHub's “Use the PR's first comment as the eventual commit message instead of the PR branch's actual commit message(s)” setting, I tend to be quite careful with that first message — hence why I put my less formal Change Descriptions etc in a separate second comment on the PR. However the Security Impact thing can deserve to be in the permanent record too, so that's fine to have moved it. And usually the pure boilerplate bits get removed during merging. 😄 |
With apologies for the slow turnaround... it looks like you might have one more minor static analysis finding -
|
In my opinion, that is a misguided diagnostic that discourages good style. See for example hail/python/hail/utils/misc.py's But if you really want me to make the code worse to appease it, I will. |
@jmarshall I'm inclined to agree with you, especially considering the extant examples. I want the linter to not error out, but if you were to make that happen by disabling this rule in pylint.rc then I'd be perfectly happy with that as a solution |
Extends PR #14544 which did this for read_input()/read_input_group().
Refactor type coercion previously added to _new_input_resource_file()
into a new hailtop.utils.path_str() utility routine, and also invoke
it from Batch.write_output().
Security Assessment
Delete all except the correct answer:
Impact Description
Client side change only. Standard function call on a standard library class. Analogous to existing calls for similar functionality.
(Reviewers: please confirm the security impact before approving)