-
Notifications
You must be signed in to change notification settings - Fork 24
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
Breaking changes #149
Comments
Whoops, I thought I had highlighted that for discussion to figure out the right track, but I guess I did that on #145. Correct, a single dataset shouldn't play nice anymore with I'm not sure how often I'd prefer to throw an error in Could become def __init__(
self,
datasets: Optional[Dict[str, xr.Dataset]] = None,
routers: Optional[APIRouter] = None,
cache_kws=None,
app_kws=None,
plugins: Optional[Dict[str, Plugin]] = None,
):
if isinstance(datasets, xr.Dataset):
raise TypeError("xpublish.Rest no longer directly handles single datasets. Please use xpublish.SingleDatasetRest instead")
self.setup_datasets(datasets or {})
self.setup_plugins(plugins)
... If we're mucking about with Since they refer to routers that apply only to datasets, not ones that are at the top level of the app, how about renaming them to |
My suggestion would be to break things in this project for a while. Usage is fairly low and development has been slow. At some point, we'll want to be careful about introducing breaking changes but I think for now, we can be fairly cavalier about these things (provided they are well reasoned). |
Agreed, @abkfenris' TypeError suggestion is good enough to me. |
If a single dataset is passed to `xpublish.Rest` it now throws a `TypeError` directing the user to use `xpublish.SingleDatasetRest`. I also found a few tests that were testing other things, but were passing a single dataset to `xpublish.Rest`. Closes xpublish-community#149
If a single dataset is passed to `xpublish.Rest` it now throws a `TypeError` directing the user to use `xpublish.SingleDatasetRest`. I also found a few tests that were testing other things, but were passing a single dataset to `xpublish.Rest`. Closes #149
@abkfenris IIUC with #146
Rest
won't work anymore with a single dataset andSingleDatasetRest
(or the accessor) must be used instead? That's good IMO but are we ok with this breaking change? Xpublish is still at an early stage of development but I don't know to which extent it is used currently (it has been there for some time already).Alternatively, perhaps it is possible to go through a smoother (short) transition using some
Rest.__new__
hack? I don't think it is really worth it, but at least we might want to add a clear error message suggesting to useSingleDatasetRest
when trying to pass a single Xarray Dataset toRest
.Are there other breaking changes? I haven't seen any but I haven't looked in-depth at #146 yet.
The text was updated successfully, but these errors were encountered: