Skip to content

Translate an empty ESGF search into DatasetResolutionError#811

Merged
lewisjared merged 2 commits into
mainfrom
fix/esgf-no-search-results
Jul 11, 2026
Merged

Translate an empty ESGF search into DatasetResolutionError#811
lewisjared merged 2 commits into
mainfrom
fix/esgf-no-search-results

Conversation

@lewisjared

@lewisjared lewisjared commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Description

Translates intake-esgf's NoSearchResults into DatasetResolutionError in IntakeESGFMixin.fetch_datasets. ref test-cases fetch already logs and skips a test case that raises DatasetResolutionError, so a single de-indexed dataset no longer crashes the whole prefetch.

This is the failure behind the red CI Integration Tests run on the #810 merge commit. The obs4MIPs C3S-GTO-ECV-9-0 record (the toz reference for the ozone diagnostics) is currently missing from the ESGF2-US-1.5-Catalog index that CI queries, but it still exists on the CEDA index and in the sample-data registry. While the record is missing, the ozone test-case catalogs stop refreshing and the committed catalogs keep the downstream jobs working.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

Summary by CodeRabbit

  • Bug Fixes
    • ESGF searches with no matching datasets now return a clear dataset resolution error.
    • Test-case prefetching can log and skip unavailable or de-indexed datasets instead of stopping the entire process.
    • Error messages now include the requested search criteria to make failed dataset lookups easier to understand.

A dataset that has been de-indexed from ESGF made cat.search() raise
intake_esgf's NoSearchResults, which escaped the per-test-case handling
in ref test-cases fetch and crashed the whole prefetch.
Raising DatasetResolutionError instead lets the fetch log and skip
the affected test case.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@lewisjared, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ccda02d5-f7ef-48a6-b0a7-ad6109384ed3

📥 Commits

Reviewing files that changed from the base of the PR and between c684cad and 686bf37.

📒 Files selected for processing (1)
  • packages/climate-ref-core/src/climate_ref_core/esgf/base.py
📝 Walkthrough

Walkthrough

Changes

ESGF no-results handling

Layer / File(s) Summary
Translate empty ESGF searches
packages/climate-ref-core/src/climate_ref_core/esgf/base.py
NoSearchResults from ESGF catalog searches is converted to DatasetResolutionError with the requested facets.
Validate prefetch behaviour
packages/climate-ref-core/tests/unit/esgf/test_base.py, changelog/811.fix.md
A unit test verifies the mapped exception, and the changelog documents skipping de-indexed datasets during prefetch.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: translating empty ESGF searches into DatasetResolutionError.
Description check ✅ Passed The description includes the required Description and Checklist sections, and the checklist covers tests and changelog items with documentation noted.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/esgf-no-search-results

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/climate-ref-core/src/climate_ref_core/esgf/base.py (1)

115-122: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Exception translation is correctly implemented.

The try/except NoSearchResults block properly catches the upstream exception and raises DatasetResolutionError with a descriptive facets-specific message. Using from None to suppress the original traceback is appropriate here since the domain error message is self-explanatory.

One observation: the pre-existing ValueError at line 129 (if cat.df is None or cat.df.empty) represents a similar "no data" scenario but raises a different exception type. If cat.search() can succeed without raising NoSearchResults yet produce an empty DataFrame (e.g., after remove_ensembles() strips all results), that ValueError would still crash the prefetch. Consider whether this path should also be translated to DatasetResolutionError for consistency with the PR's goal of graceful skipping.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e3b067f-f74c-4eee-a050-b23e71942c6b

📥 Commits

Reviewing files that changed from the base of the PR and between 72d085d and c684cad.

📒 Files selected for processing (3)
  • changelog/811.fix.md
  • packages/climate-ref-core/src/climate_ref_core/esgf/base.py
  • packages/climate-ref-core/tests/unit/esgf/test_base.py

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core 92.44% <100.00%> (+<0.01%) ⬆️
providers 86.99% <ø> (ø)

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

Files with missing lines Coverage Δ
...climate-ref-core/src/climate_ref_core/esgf/base.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lewisjared lewisjared merged commit 2722d0e into main Jul 11, 2026
28 checks passed
@lewisjared lewisjared deleted the fix/esgf-no-search-results branch July 11, 2026 23:36
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.

1 participant