C-Accel-CRIPT / sdk-archive

CRIPT Python SDK
MIT License
11 stars 0 forks source link

citation from reference object save #42

Closed InnocentBug closed 1 year ago

InnocentBug commented 2 years ago

With the citation, I discuss in #41 I want to create a citation. but

    pipeline_citation = cript.Citation(pipeline_ref)
    api.save(pipeline_citation)

Throws:

Traceback (most recent call last):
  File "/home/ludwig/git/sim_data_model/refactor_sdk.py", line 303, in <module>
    main(sys.argv[1:])
  File "/home/ludwig/git/sim_data_model/refactor_sdk.py", line 60, in main
    api.save(pipeline_citation)
  File "<@beartype(cript.api.API.save) at 0x7fd04923f940>", line 22, in save
  File "/home/ludwig/.local/lib/python3.9/site-packages/beartype/_decor/_error/errormain.py", line 301, in raise_pep_call_exception
    raise exception_cls(  # type: ignore[misc]
beartype.roar.BeartypeCallHintParamViolation: @beartyped API.save() parameter node={
    "reference": "https://criptapp.org/api/reference/be2b203a-bcd5-48b1-b66b-be8465eb4497/"... violates type hint <class 'cript.data_model.nodes.base_node.BaseNode'>, as {
    "reference": "https://criptapp.org/api/reference/be2b203a-bcd5-48b1-b66b-be8465eb4497/"... not instance of <protocol "cript.data_model.nodes.base_node.BaseNode">.
InnocentBug commented 2 years ago

This also happens with other instances that get refreshed. I tried it with Software.

nh916 commented 1 year ago

The SDK changed with version 0.5 or 0.6 where api.save() no longer exists and instead the objects themselves have a .save method

I think you could fix the issue with:

pipeline_citation = cript.Citation(pipeline_ref)
pipeline_citation .save()
InnocentBug commented 1 year ago

Yes, this is ineed an old issue that was carried over from the last version.