nodet / dowml

A library and command line client to use Decision Optimization on IBM Watson Machine Learning (WML). NOT SUPPORTED BY IBM.
Apache License 2.0
3 stars 0 forks source link

Add information in 'location' for input data assets? #35

Closed nodet closed 2 years ago

nodet commented 2 years ago

The library currently builds input data references that look like this:

{
   'connection': {},
   'id': 'afiro.mps',
   'location': {'href': '/v2/assets/0d2966b8-a1d9-4382-88e2-e9e20e8886bf?space_id=4645be25-e08e-4a34-a475-ff3cd0dc9635'},
   'type': 'data_asset'
}

But the output data references that come back look like this:

{
   'connection': {},
   'id': 'solution.json',
   'location': {
      'href': 'https://api.eu-de.dataplatform.cloud.ibm.com/v2/assets/8132d1f1-be47-4cec-aaf1-8f52f3ec4074?space_id=4645be25-e08e-4a34-a475-ff3cd0dc9635',
      'id': '8132d1f1-be47-4cec-aaf1-8f52f3ec4074'
   },
   'type': 'data_asset'
}

Note in the location section how the href is a complete URL rather than just the 'REST API' part, and it has an id.

At this time, everything is fine and WML handles well the references that are sent. But one can wonder whether the beefier version should be sent.

nodet commented 2 years ago

The additional information in the 'complete' version is actually redundant (the id already appears in the href, and the 'website' part of the URL must be known anyway to start anything. I would rather not generate useless (or worse, incoherent) content, so let's not change anything.

Moreover, the code of the library must be ready to deal with the 'skinnier' version of the references: it may have to deal with jobs that it didn't create, and shouldn't assume more than what's strictly necessary.