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

Return deepcopy of assets from get_assets #1087

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

jsignell
Copy link
Member

@jsignell jsignell commented Apr 7, 2023

Related Issue(s):

Description:

Instead of making a shallow copy, just return the object itself. Always create a new dict and deepcopy all values

I grepped around for other places where dict or .copy are used, and this was all I found

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.

@gadomski gadomski self-requested a review April 7, 2023 19:39
@gadomski gadomski added this to the 1.8 milestone Apr 7, 2023
@jsignell jsignell linked an issue Apr 10, 2023 that may be closed by this pull request
pystac/collection.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 ⚠️

Comparison is base (0f90e7a) 90.23% compared to head (afc69d6) 90.21%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1087       /-   ##
==========================================
- Coverage   90.23%   90.21%   -0.02%     
==========================================
  Files          47       47              
  Lines        6236     6224      -12     
  Branches      936      932       -4     
==========================================
- Hits         5627     5615      -12     
  Misses        428      428              
  Partials      181      181              
Impacted Files Coverage Δ
pystac/collection.py 94.75% <100.00%> (-0.12%) ⬇️
pystac/item.py 92.92% <100.00%> (-0.20%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jsignell jsignell changed the title Return assets from get_assets not a shallow copy Return deepcopy of assets from get_assets Apr 11, 2023
@jsignell jsignell requested a review from gadomski April 11, 2023 18:15
@gadomski gadomski enabled auto-merge April 12, 2023 22:04
@gadomski gadomski added this pull request to the merge queue Apr 12, 2023
Merged via the queue into stac-utils:main with commit b0c4f25 Apr 12, 2023
@jsignell jsignell deleted the mutable-refs branch April 13, 2023 13:41
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.

RFC: Passing around mutable references
3 participants