Skip to content

[ENH] Improve error handling of _get_data_by_filename in data/examples.py - #2405

Open
victorwon2001 wants to merge 1 commit into
sktime:mainfrom
victorwon2001:fix/issue-2152
Open

[ENH] Improve error handling of _get_data_by_filename in data/examples.py#2405
victorwon2001 wants to merge 1 commit into
sktime:mainfrom
victorwon2001:fix/issue-2152

Conversation

@victorwon2001

Copy link
Copy Markdown
LLM generated content, by GPT-5.6 Sol

Reference Issues/PRs

Fixes #2152

What does this implement/fix? Explain your changes.

Downloads for uncached example data are now written to a temporary directory under the cache location and moved to the final cache path only after urlretrieve() completes successfully. Failed transfers therefore do not leave a partial file that a later call could mistake for a valid cached download, while existing cache-hit behavior and download exceptions remain unchanged.

What should a reviewer concentrate their feedback on?

  • The temporary-download publication behavior and preservation of the existing cache and exception semantics.

Did you add any tests for the change?

Yes. Regression tests cover cache hits, successful publication, cleanup after partial ContentTooShortError and URLError failures, and retrying after a failed download. The focused tests, the full tests/test_data suite, and pre-commit checks pass; repository-wide pytest runs were interrupted before completion with no failures observed before termination.

Any other comments?

None.

PR checklist

  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
  • Added/modified tests
  • Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with pre-commit install.
    To run hooks independent of commit, execute pre-commit run --all-files

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@67c354f). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2405   +/-   ##
=======================================
  Coverage        ?   88.20%           
=======================================
  Files           ?      200           
  Lines           ?    11174           
  Branches        ?        0           
=======================================
  Hits            ?     9856           
  Misses          ?     1318           
  Partials        ?        0           
Flag Coverage Δ
cpu 88.20% <100.00%> (?)
pytest 88.20% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[ENH] Improve error handling of _get_data_by_filename in data/examples.py

1 participant