Skip to content

Fix pydantic error In SLURM API model as gres_detail field can be an empty list#310

Open
isikhar wants to merge 1 commit into
mainfrom
gres_detail_empty
Open

Fix pydantic error In SLURM API model as gres_detail field can be an empty list#310
isikhar wants to merge 1 commit into
mainfrom
gres_detail_empty

Conversation

@isikhar

@isikhar isikhar commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Apparently SLURM API v0.0.44 allows gres_detail field to be an empty string that results in current model implementation raising a pydantic error.

jobs.130.gres_detail.0
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.13/v/string_type

This patch fixes this issue enabling JobInfoGresDetail type object to be an empty list.

@isikhar isikhar requested a review from ndevenish June 16, 2026 16:03
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.35%. Comparing base (0225caf) to head (6f4d816).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   81.41%   81.35%   -0.06%     
==========================================
  Files          31       31              
  Lines        5730     5755      +25     
  Branches      330      332       +2     
==========================================
+ Hits         4665     4682      +17     
- Misses        989      995       +6     
- Partials       76       78       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ndevenish

Copy link
Copy Markdown
Contributor

Empty string or missing string?

IIRC the OpenAPI spec is manual, so this must just be a mistake

@isikhar

isikhar commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Jobs triggering DLSClusterMonitor crashes with the above error had gres_detail field set as an empty list.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants