Repository navigation
docs: submit_bash_job takes script, not code_path - #9655
Open
VenishPaneliya wants to merge 1 commit into
Open
VenishPaneliya wants to merge 1 commit into
VenishPaneliya wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
submit_bash_jobexample indocs/API.md, we previously passedcode_path="/path/to/script.sh", which raisedTypeError: submit_bash_job() got an unexpected keyword argument 'code_path'. Now the docs passscript="echo hello", which is the parameter the method actually takes, and the value it expects.The second parameter is
scriptin all four places it is declared —SyftRDSClient.submit_bash_job(packages/syft-rds/src/syft_rds/client.py:438),JobClient.submit_bash_job(packages/syft-job/src/syft_job/client.py:193) and its protocol stub at line 74, andEnclaveJobClient.submit_bash_job(packages/syft-enclave/src/syft_enclaves/enclave_job_client.py:41).docs/API.mdwas the only place calling itcode_path, which is the namesubmit_python_jobuses.It is also not a path.
JobClient.submit_bash_job's docstring says "Bash script content to execute", and every call in the repo passes source text:script="echo hello"inpackages/syft-job/tests/migrations/p2p/test_current_protocol.py:28and inpackages/syft-job/scripts/generate_release_fixture.py:60. So the old example taught the wrong kind of value as well as the wrong name. The entry now names both parameters, matching thesubmit_python_jobentry above it.The documented default for
job_namewasNone; the real default is"", and the method callsjob_name.strip()on it, soNonewould raise.Guidelines
High level
submit_bash_jobentry indocs/API.mdto match the method.Mid level
Low level
Security
No change.
Testing
Built an
inspect.Signaturefrom the realSyftRDSClient.submit_bash_jobAST and bound both calls against it: the documented one fails withmissing a required argument: 'script', the corrected one binds to{'user': ..., 'script': 'echo hello', 'job_name': '', 'force_submission': False, 'ignore_peer_version': False}. Docs-only change, so no code paths are touched.Asana task
Not an Asana-tracked task — found while reading
docs/API.mdagainst the client.