Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make item pickle smaller #1285

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Make item pickle smaller #1285

merged 3 commits into from
Dec 12, 2023

Conversation

jsignell
Copy link
Member

@jsignell jsignell commented Dec 4, 2023

Related Issue(s):

Description:

Not totally sure if this is a good idea, but I figured a PR would be a good place to hash that out. The only limitation I can see is that if you have a resolved target object on your link, it will not be resolved with you roundtrip it to pickle and back.

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c5a79c7) 91.11% compared to head (156ae44) 91.12%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1285      +/-   ##
==========================================
+ Coverage   91.11%   91.12%   +0.01%     
==========================================
  Files          51       51              
  Lines        6986     6994       +8     
  Branches      999     1001       +2     
==========================================
+ Hits         6365     6373       +8     
  Misses        444      444              
  Partials      177      177              

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

Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

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

The only limitation I can see is that if you have a resolved target object on your link, it will not be resolved with you roundtrip it to pickle and back.

This feels like the right behavior -- you (theoretically) can always re-resolve the object later. I'm ok with this change, but I'm not the target user here -- is there anyone that uses pystac in Dask-land that can verify that things are better w/ this fix. Maybe @TomAugspurger?

Copy link
Collaborator

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

Won't have time to test this out for real, but in general I've found len(pickle.dumps(obj)) to be a good enough test for fixes like this.

pystac/item.py Outdated Show resolved Hide resolved
@jsignell jsignell added this pull request to the merge queue Dec 12, 2023
Merged via the queue into stac-utils:main with commit 8d03733 Dec 12, 2023
20 checks passed
@jsignell jsignell deleted the pickling branch December 12, 2023 13:26
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