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

Object serialization should not make network requests by default #960

Open
gadomski opened this issue Jan 20, 2023 · 1 comment
Open

Object serialization should not make network requests by default #960

gadomski opened this issue Jan 20, 2023 · 1 comment
Labels
breaking Represents a potentially breaking change that may warrant a major version release
Milestone

Comments

@gadomski
Copy link
Member

As discussed in #958, Item.to_dict can make one or more network requests if an object's root is unresolved and transform_hrefs == True (the default). This can lead to a huge number of near-simultaneous network requests, e.g. in the case of large scale batch processing of Items read in from a data store (e.g. a geoparquet table).

The simplest fix would be to make transform_hrefs default to False for all of PySTAC. This would be a breaking change, since the default behavior would be changing in potentially unexpected ways. This issue is intended to track this potential change, with the goal of gathering feedback and alternatives before a future PySTAC v2.0.

@ircwaves
Copy link
Member

ircwaves commented Aug 26, 2024

The hits keep coming!

https://github.com/stac-utils/pystac/blob/main/pystac/link.py#L154-L156

NBD:

find . -type f -name '*.py' \
    | xargs -I{} sed -i~ -e 's/link\.href/link.get_href(transform_href=False)/g' {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Represents a potentially breaking change that may warrant a major version release
Projects
None yet
Development

No branches or pull requests

2 participants