Fix a bug in azslurm cost#486
Conversation
Job State is a list and not a static field.
There was a problem hiding this comment.
Pull request overview
Fixes azslurm cost behavior with newer Slurm squeue --json output by correctly handling job_state as a list of states (while retaining compatibility with the older string form), and also corrects a typo that would prevent CostSlurm initialization.
Changes:
- Fix
self.endassignment typo inCostSlurm.__init__. - Update
process_queue()to treatjob_stateas either a string or a list and filter running/configuring jobs accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR fixes azslurm cost processing when parsing squeue --json output by handling job_state as either a string (older Slurm) or a list (newer Slurm), ensuring running/configuring jobs are detected correctly.
Changes:
- Fix a typo in
CostSlurm.__init__(self.endassignment). - Normalize
job_stateto a list and update the running/configuring filter logic inprocess_queue().
You can also share your feedback on Copilot code review. Take the survey.
Job State is a list and not a static field.