Conversation
| """ | ||
| Load a DataCube by collection id. | ||
|
|
||
| :param collection_id: image collection identifier |
There was a problem hiding this comment.
Should this be deprecated instead of being removed?
There was a problem hiding this comment.
Would I just put @deprecated("Use 'id' instead") above the :param collection_id line?
There was a problem hiding this comment.
Sounds good to me, but @soxofaan should have the final vote.
There was a problem hiding this comment.
I don't think we can make a breaking change like this.
Existing code that uses keyword argument load_collection(collection_id="S2") will break.
There should be a fallback mechanism:
- give
iddefault value None - add a
**kwargsand check ifcollection_idis set (and raise deprecation warning if that is the case)
There was a problem hiding this comment.
Yes, that's what I meant to say :-D
There was a problem hiding this comment.
def load_collection(
self,
id: str = None,
[...]
if "collection_id" in kwargs:
id = kwargs["collection_id"]
warnings.warn("The use of `collection_id` is deprecated, use `id` instead.", DeprecationWarning)like so?
| if self._api_version.at_least("1.0.0"): | ||
| return DataCube.load_collection( | ||
| collection_id=collection_id, connection=self, | ||
| collection_id=id, connection=self, |
There was a problem hiding this comment.
I think the load_collection methods of DataCube and ImageCollectionClient should also be addressed
but here it's fine to do it in a backwards incompatible way because these are practically "internal" methods nobody should be using
|
also to do:
|
What do you mean by this? |
|
test that both |
|
Alright, did that. Didn't add tests for |
Should the parameter also be changed in
datacube.load_collection()andimagecollectionclient.load_collection()?