SciCatProject / pyscicat

A python client library for interacting with the SciCat data catalog backend.
Other
0 stars 9 forks source link

Compatibility with upcoming version of scicat backend #18

Open dylanmcreynolds opened 2 years ago

dylanmcreynolds commented 2 years ago

The upcoming backend has different endpoints than the production (loopback) version of backend. Several things known:

- v3 is now v4 (Edit, this is not the case)

dylanmcreynolds commented 2 years ago

Several issues that we might want to take care of at the same time.

There is enough different between the new nest.js backend and the old one that right now, pyscicat will not work with the new version. The major different is that the endpoints have changed. The issues I know about today are that there used to be three sets of we need to decide how to deal with it.

At this point, the new version has one set of dataset endpoints, while the old version has three: Dataset, RawDataset, and DerivedDataset. Currently, pyscicat has three methods that correspond to this.

The version of the api that pyscicat talks to is sent with the URL that the called uses to construct the pyscicat instance.

I propose making changes to pyscicat with the following goals in mind:

  1. Make pyscicat compatible with either v3 or v4.
  2. Match the new backend version's single endpoint mechanism in the pyscicat API.

To do this, I propose:

  1. Add code in the ScicatClient constructor that checks for /v3 or /v4, storing the result in an attribute.
  2. In all three upload methods, swizzle the url appropriately for the correct version of the API.
  3. Deprecate the calls upload_new_dataset and upload_raw_dataset, removing them in a future version.

Adding to this conversaion @nitrosx @abigailalexander

dylanmcreynolds commented 2 years ago

At the developer's meeting, we discussed the future of the version indicator in the URL. It was decided that we would leave it as v3 for now, and at at some future time remove it altogether.

We also discussed the impact of making breaking changes to pyscicat at this point. We would like to simplify a little, removing the multiple calls to data set types.

So we propose to remove the upload_new_dataset and upload_raw_dataset calls from pyscicat.