You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing link from Asset to owner Item after signing STAC Item #25
When making a clone of an Asset object .owner property is reset to None. Since Item is fully cloned when signing there is no need to then also clone all the assets. I would suggest adding in place signing option to pc.sign(asset) that skips cloning of an asset and just modifies passed in object in place, then use that option from pc.sign(item) overload.
Adding an option to skip cloning / operate in place makes sense to me. API-wise, I think we call it either copy=True/False or clone=True/False (the default being to clone). I guess pystac uses preserve_dict=True, but that's in the context of dict -> pystac object.
Thanks Tom Augspurger (@TomAugspurger), I'm not in a hurry for these fixes to be released as I ended up signing at url level as that fits for my use case better anyway, but then I'm also not planning any more additions to this, so if you want this fix released sooner that would be great too.
Activity
Kirill888 commentedon Sep 2, 2021
When making a clone of an Asset object
.ownerproperty is reset toNone. Since Item is fully cloned when signing there is no need to then also clone all the assets. I would suggest addingin placesigning option topc.sign(asset)that skips cloning of an asset and just modifies passed in object in place, then use that option frompc.sign(item)overload.planetary-computer-sdk-for-python/planetary_computer/sas.py
Lines 116 to 126 in 998d18c
TomAugspurger commentedon Sep 2, 2021
Adding an option to skip cloning / operate in place makes sense to me. API-wise, I think we call it either
copy=True/Falseorclone=True/False(the default being to clone). I guess pystac usespreserve_dict=True, but that's in the context of dict -> pystac object.Ensure signed item's assets point back to the item (microsoft#25)
Ensure signed item's assets point back to the item (#25) (#26)
TomAugspurger commentedon Sep 7, 2021
Kirill Kouzoubov (@Kirill888) do you need a release with #25 in it, or do you have any additional testing / changes before you'd want a release?
Kirill888 commentedon Sep 7, 2021
Thanks Tom Augspurger (@TomAugspurger), I'm not in a hurry for these fixes to be released as I ended up signing at url level as that fits for my use case better anyway, but then I'm also not planning any more additions to this, so if you want this fix released sooner that would be great too.
TomAugspurger commentedon Sep 9, 2021
👍 0.4.1 is up on PyPI now https://pypi.org/project/planetary-computer/