-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add data_type
to open_data
method in DataStore
class
#1037
Add data_type
to open_data
method in DataStore
class
#1037
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work, thanks! See my change requests and please adjust accordingly.
xcube/core/store/store.py
Outdated
self, | ||
data_id: str, | ||
opener_id: str = None, | ||
data_type: DataTypeLike = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding keyword data_type
is a change that breaks compatibility with any data store developed against older versions of xcube.
We should instead document the parameter here - as you did - and update data store implementations subsequently. Only after we have migrated all of our own data stores and after next xcube major release, we should define the kwarg here as you did.
Therefore, the xcube-stac store should pop data_type
out of the open_params
for time being.
CHANGES.md
Outdated
* Added `data_type` to `open_data` method in the `DataStore` class, which determines | ||
the return value of the data set. Note that `opener_id` includes the `data_type` | ||
at its first position and will override the `date_type` argument. (#1030) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Added `data_type` to `open_data` method in the `DataStore` class, which determines | |
the return value of the data set. Note that `opener_id` includes the `data_type` | |
at its first position and will override the `date_type` argument. (#1030) | |
* The `open_data` method of xcube's default `xcube.core.store.DataStore` implementations | |
now support a keyword argument `data_type`, which determines | |
data type of the return value. Note that `opener_id` includes the `data_type` | |
at its first position and will override the `date_type` argument. | |
To preserve backward compatibility, the the keyword argument `data_type` | |
has not yet been added to the `open_data()` method arguments. (#1030) |
If *opener_id* is given, the identified data opener will be used | ||
to open the data resource and *open_params* must comply with the | ||
schema of the opener's parameters. Note that some store | ||
implementations may not support using different openers or just | ||
support a single one. | ||
|
||
If *data_type* is provided, the return value will be in the specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If *data_type* is provided, the return value will be in the specified | |
Implementations are advised to support an additional optional keyword | |
argument `data_type: DataTypeLike = None`. | |
If *data_type* is provided, the return value should be in the specified |
FYI @TonioF (xcube-cci), @pont-us (xcube-cds), @TejasMorbagal (xcube-cmems) |
As suggested, I included in keyword argument |
True.
Let's do that! |
Closes #1030
Checklist:
New/modified features documented indocs/source/*
CHANGES.md