MaayanLab / FAIRshake

https://fairshake.cloud
Other
11 stars 6 forks source link

Error creating project in coreapi tutorial #164

Closed nicole-brewer closed 3 years ago

nicole-brewer commented 3 years ago

I am trying to follow along with the coreapi tutorial. So far I haven't changed anything in the notebook except replacing the authentication token with my own. When I try to create a project with an object I get the error ParameterError: {'digital_objects': 'Unknown parameter.'}.

This is the cell that has the error:

# Create a project
proj = client.action(schema, ['project', 'create'], params=dict(
  url='http://my-objects.com',
  title='My Project',
  description='Project is great',
  tags='my project test',
  digital_objects=[obj_id],
))
proj_id = proj['id']
proj

Traceback:

---------------------------------------------------------------------------
ParameterError                            Traceback (most recent call last)
<ipython-input-12-1e3d1a68b29c> in <module>
      1 # Create a project
----> 2 proj = client.action(schema, ['project', 'create'], params=dict(
      3   url='http://my-objects.com',
      4   title='My Project',
      5   description='Project is great',

~/miniconda3/envs/jupyter/lib/python3.9/site-packages/coreapi/client.py in action(self, document, keys, params, validate, overrides, action, encoding, transform)
    163         link, link_ancestors = _lookup_link(document, keys)
    164         if validate:
--> 165             _validate_parameters(link, params)
    166 
    167         if overrides:

~/miniconda3/envs/jupyter/lib/python3.9/site-packages/coreapi/client.py in _validate_parameters(link, parameters)
     78 
     79     if errors:
---> 80         raise exceptions.ParameterError(errors)
     81 
     82 

ParameterError: {'digital_objects': 'Unknown parameter.'}

Let me know if I can provide more details, thanks!

u8sand commented 3 years ago

@nicole-brewer sorry about that, we removed the relationship in this direction a little while back because some projects have ridiculous amounts of digital objects.

Instead you can associate the project to the digital object. That-is digital object has a parameter projects that takes a list of projects. I've just updated the tutorial accordingly. Please let us know if you run into additional issues.

nicole-brewer commented 3 years ago

That make sense! Thanks for the quick feedback