Skip to content

docs: submit_bash_job takes script, not code_path - #9655

Open
VenishPaneliya wants to merge 1 commit into
OpenMined:devfrom
VenishPaneliya:fix-submit-bash-job-docs
Open

VenishPaneliya wants to merge 1 commit into
OpenMined:devfrom
VenishPaneliya:fix-submit-bash-job-docs

Conversation

@VenishPaneliya

Copy link
Copy Markdown
Contributor

Summary

  • When a DS follows the submit_bash_job example in docs/API.md, we previously passed code_path="/path/to/script.sh", which raised TypeError: submit_bash_job() got an unexpected keyword argument 'code_path'. Now the docs pass script="echo hello", which is the parameter the method actually takes, and the value it expects.

The second parameter is script in 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, and EnclaveJobClient.submit_bash_job (packages/syft-enclave/src/syft_enclaves/enclave_job_client.py:41). docs/API.md was the only place calling it code_path, which is the name submit_python_job uses.

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" in packages/syft-job/tests/migrations/p2p/test_current_protocol.py:28 and in packages/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 the submit_python_job entry above it.

The documented default for job_name was None; the real default is "", and the method calls job_name.strip() on it, so None would raise.

Guidelines

High level

  • 🟢 Split: one entry in one file.
  • 🟢 Size: corrects the submit_bash_job entry in docs/API.md to match the method.

Mid level

  • 🟢 User-facing code
  • 🟢 Error handling
  • 🟢 State versioning
  • 🟢 Function structure
  • 🟢 Tests

Low level

  • 🟢 Naming
  • 🟢 Code style

Security

No change.

Testing

Built an inspect.Signature from the real SyftRDSClient.submit_bash_job AST and bound both calls against it: the documented one fails with missing 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.md against the client.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant