Skip to content

Capture ResourcePath transfer_from exception in copy_files_for_distribution#108

Open
zhaoyuyoung wants to merge 1 commit into
mainfrom
tickets/DM-54502
Open

Capture ResourcePath transfer_from exception in copy_files_for_distribution#108
zhaoyuyoung wants to merge 1 commit into
mainfrom
tickets/DM-54502

Conversation

@zhaoyuyoung
Copy link
Copy Markdown
Contributor

Checklist

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.77%. Comparing base (01a8ea7) to head (3e517ff).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
python/lsst/ctrl/bps/panda/utils.py 42.85% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #108      +/-   ##
==========================================
+ Coverage   34.88%   36.77%   +1.89%     
==========================================
  Files          13       13              
  Lines        1313     1327      +14     
  Branches      214      215       +1     
==========================================
+ Hits          458      488      +30     
+ Misses        835      817      -18     
- Partials       20       22       +2     

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

Comment thread python/lsst/ctrl/bps/panda/utils.py Outdated
future_file_copy = {}
for src, trgt in files_to_copy.items():
_LOG.debug("Staging %s to %s", src, trgt)
future = copy_executor.submit(trgt.transfer_from, src, transfer="copy")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code is more complicated than it needs to be. If trgt and src are ResourcePath objects then ResourcePath.mtransfer can do all of this itself so you can delete most of this code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check ResourcePath.mtransfer. This is a piece of legacy codes that started with IDF, so I guess it exists for a reason.

At the same time, I've found the reason why w_2026_12 failed to copy the quantum graph with the wrong protocol http:/ at RAL. It turns out the uri is treated as a local file other than the WebDAV one. So it's not a silent failure, but a successful transfer_from to the wrong destination.

Copy link
Copy Markdown
Member

@timj timj May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It existed before ResourcePath.mtransfer was written and which does exactly what this legacy code does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for showing me this very useful tool. I've changed to use ResourcePath.mtransfer and the exception it catches. Will ask for a review next week.

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