Skip to content

Avoid issue with deepcopying/pickling IntakeESGFDatasets#2990

Open
bouweandela wants to merge 6 commits intomainfrom
fix-intake-esgf-issue
Open

Avoid issue with deepcopying/pickling IntakeESGFDatasets#2990
bouweandela wants to merge 6 commits intomainfrom
fix-intake-esgf-issue

Conversation

@bouweandela
Copy link
Member

@bouweandela bouweandela commented Feb 19, 2026

Description

Closes #2989

Link to documentation:


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@bouweandela bouweandela added the bug Something isn't working label Feb 19, 2026
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2990   +/-   ##
=======================================
  Coverage        ?   95.69%           
=======================================
  Files           ?      267           
  Lines           ?    15733           
  Branches        ?        0           
=======================================
  Hits            ?    15055           
  Misses          ?      678           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bouweandela bouweandela force-pushed the fix-intake-esgf-issue branch from 60f584e to 11574e6 Compare February 19, 2026 10:01
@bouweandela bouweandela force-pushed the fix-intake-esgf-issue branch from 7f8dc19 to 2216c23 Compare February 19, 2026 10:40
for arg, value in kwargs.items()
}
for fn, kwargs in settings.items()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't you dump to a json payload that can be serialized and passed around?

Copy link
Member Author

Choose a reason for hiding this comment

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

We use requests_cache.CachedSession objects with intake-esgf to make repeat searches fast. Those aren't trivially serializeable (see requests-cache/requests-cache#707 for some background), regardless of how you serialize them. We don't need to serialize Dataset.files because we can just search for them again. Therefore, this seems the simplest solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

very interesting - thanks for the pointer, bud! Why do I have the feeling that a Dataset can be serialized since it's a dictionary of simple objects (not too complicated for JSON) and also the Session can be serialized since the connection configuration is simple - OK no other stuff like backends and more complicated things though - question is, would that help vs searching for the file again? or am I trying to fit a square peg in a round hole? I am not a fan of pickles though, security-wise 🥒

Copy link
Member Author

Choose a reason for hiding this comment

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

I really don't think this is worth optimizing. It should be no problem to search for the same file more than once occasionally, with the current code this only happens when the target dataset for the regrid preprocessor function is a dataset.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah that's why I decided to dump (pun intended) my idea above - just realized it's a corner case anyway 😀

@bouweandela bouweandela marked this pull request as ready for review February 19, 2026 15:44
Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

leave the guff about JSON aside for now, adopting the quick solution 🍺 BTW are you familiar with CBOR (since I am on about JSON) - just found out about it - lots smoother than JSON

@bouweandela
Copy link
Member Author

I haven't used CBOR before, but it looks nice.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recipe run fails when target grid is dataset and data source is intake-esgf

2 participants

Comments