fix: correct kwargs key names in SlurmJob fluent setters#11
Open
prabindersinghh wants to merge 1 commit intoouterbounds:mainfrom
Open
fix: correct kwargs key names in SlurmJob fluent setters#11prabindersinghh wants to merge 1 commit intoouterbounds:mainfrom
prabindersinghh wants to merge 1 commit intoouterbounds:mainfrom
Conversation
The cpus_per_task(), memory(), and run_time_limit() setter methods wrote wrong keys into self.kwargs: cpus_per_task() wrote 'cpus-per-task' (hyphen) memory() wrote 'mem' run_time_limit() wrote 'time' But create_slurm_script() reads 'cpus_per_task', 'memory', and 'run_time_limit' (underscores). The mismatch meant all three values were silently dropped — every job ran with default CPUs, memory, and time limit regardless of what the user specified. Fix: rename the three keys to match what create_slurm_script() reads.
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
Fixes #10
The
cpus_per_task(),memory(), andrun_time_limit()fluent settermethods wrote incorrect keys into
self.kwargs, butcreate_slurm_script()reads different keys. The mismatch meant allthree values were silently dropped — every job ran with default CPUs,
memory, and time limit regardless of what the user specified.
create_slurm_script()cpus_per_task()"cpus-per-task"(hyphen)"cpus_per_task"(underscore)memory()"mem""memory"run_time_limit()"time""run_time_limit"Changes
metaflow_extensions/slurm_ext/plugins/slurm/slurm_job.py— 3 key renamestest/unit/test_slurm_job.py— new file, 8 unit testsTesting
8 new unit tests in
test/unit/test_slurm_job.py:test_cpus_per_task_setter_writes_correct_keytest_memory_setter_writes_correct_keytest_run_time_limit_setter_writes_correct_keytest_create_slurm_script_includes_cpus_per_task_directivetest_create_slurm_script_includes_mem_directivetest_create_slurm_script_includes_time_directivetest_create_slurm_script_chained_fluent_apitest_kwargs_constructor_path_still_worksAll 8 pass. Zero regressions.