Skip to content

DM-56065: Fix exception-causing bug when 0 job arguments. - #106

Merged
MichelleGower merged 3 commits into
mainfrom
tickets/DM-56065
Sep 16, 2026
Merged

MichelleGower merged 3 commits into
mainfrom
tickets/DM-56065

Conversation

@MichelleGower

@MichelleGower MichelleGower commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.35%. Comparing base (e0b1e65) to head (289d4b3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   88.23%   88.35%   +0.11%     
==========================================
  Files          21       21              
  Lines        5006     5040      +34     
  Branches      500      502       +2     
==========================================
+ Hits         4417     4453      +36     
  Misses        499      499              
+ Partials       90       88       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@tcjennings

Copy link
Copy Markdown
Contributor

This is the kind of error that mypy and other static type checkers are designed to prevent. In fact, it looks like there are more of exactly this potential runtime error that might be worth fixing up in this fix.

python/lsst/ctrl/bps/htcondor/lssthtc.py:1522: error: Name "job_type" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/lssthtc.py:1753: error: Name "wms_workflow_id" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/lssthtc.py:1784: error: Name "wms_workflow_id" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/lssthtc.py:2231: error: Name "last_warning" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/prepare_utils.py:383: error: Name "arguments" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/prepare_utils.py:386: error: Name "arguments" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/report_utils.py:129: error: Name "dag_ad" may be undefined  [possibly-undefined]

Comment thread python/lsst/ctrl/bps/htcondor/prepare_utils.py Outdated
Comment thread python/lsst/ctrl/bps/htcondor/prepare_utils.py Outdated
@MichelleGower

Copy link
Copy Markdown
Contributor Author

This is the kind of error that mypy and other static type checkers are designed to prevent. In fact, it looks like there are more of exactly this potential runtime error that might be worth fixing up in this fix.

python/lsst/ctrl/bps/htcondor/lssthtc.py:1522: error: Name "job_type" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/lssthtc.py:1753: error: Name "wms_workflow_id" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/lssthtc.py:1784: error: Name "wms_workflow_id" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/lssthtc.py:2231: error: Name "last_warning" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/prepare_utils.py:383: error: Name "arguments" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/prepare_utils.py:386: error: Name "arguments" may be undefined  [possibly-undefined]
python/lsst/ctrl/bps/htcondor/report_utils.py:129: error: Name "dag_ad" may be undefined  [possibly-undefined]

I fixed all of the "may be undefined" reported by mypy --enable-error-code possibly-undefined python.

@MichelleGower
MichelleGower merged commit f5f5b79 into main Sep 16, 2026
22 checks passed
@MichelleGower
MichelleGower deleted the tickets/DM-56065 branch September 16, 2026 20:23
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.

3 participants