Git Product home page Git Product logo

Comments (5)

cmungall avatar cmungall commented on May 27, 2024 1

this is a bit cryptic!

from schemasheets.

turbomam avatar turbomam commented on May 27, 2024

I don't know what problem I was having with examples in the past. schemasheets seems to handle single and multiple, delimited examples fine now. I did not add any new code, just working examples.

from schemasheets.

turbomam avatar turbomam commented on May 27, 2024

Ahh... I was getting an error when creating a SchemaView from a YAML file, created by schemasheets, from a TSV with an examples column

From sheets_and_friends/sheets_and_friends/shuttle.py:

Traceback (most recent call last):
File "", line 1, in
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/mark/gitrepos/sheets_and_friends/sheets_and_friends/shuttle.py", line 42, in do_shuttle
shuttle.prepare_dest_schema()
File "/home/mark/gitrepos/sheets_and_friends/sheets_and_friends/shuttle.py", line 75, in prepare_dest_schema
current_view = SchemaView(self.recipient_model_fp)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/schemaview.py", line 102, in init
schema = load_schema_wrap(schema)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/schemaview.py", line 56, in load_schema_wrap
schema = yaml_loader.load(path, target_class=SchemaDefinition, **kwargs)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/loaders/loader_root.py", line 85, in load
results = self.load_any(*args, **kwargs)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/loaders/yaml_loader.py", line 25, in load_any
return self.load_source(source, loader, target_class, accept_header="text/yaml, application/yaml;q=0.9",
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/loaders/loader_root.py", line 66, in load_source
return target_class(**data_as_dict)
File "", line 50, in init
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/meta.py", line 402, in post_init
self._normalize_inlined_as_dict(slot_name="classes", slot_type=ClassDefinition, key_name="name", keyed=True)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 100, in _normalize_inlined_as_dict
self._normalize_inlined(slot_name, slot_type, key_name, keyed, False)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 200, in _normalize_inlined
form_1({k: v})
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 153, in form_1
order_up(key, slot_type(**as_dict(raw_obj)))
File "", line 59, in init
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/meta.py", line 1348, in post_init
self._normalize_inlined_as_dict(slot_name="slot_usage", slot_type=SlotDefinition, key_name="name", keyed=True)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 100, in _normalize_inlined_as_dict
self._normalize_inlined(slot_name, slot_type, key_name, keyed, False)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 200, in _normalize_inlined
form_1({k: v})
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 153, in form_1
order_up(key, slot_type(**as_dict(raw_obj)))
File "", line 84, in init
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/meta.py", line 1221, in post_init
super().post_init(**kwargs)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/meta.py", line 638, in post_init
super().post_init(**kwargs)
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/meta.py", line 297, in post_init
self.examples = [v if isinstance(v, Example) else Example(**as_dict(v)) for v in self.examples]
File "/home/mark/.cache/pypoetry/virtualenvs/sheets-and-friends-eIKNSve2-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/meta.py", line 297, in
self.examples = [v if isinstance(v, Example) else Example(**as_dict(v)) for v in self.examples]
TypeError: linkml_runtime.linkml_model.meta.Example() argument after ** must be a mapping, not extended_str

from schemasheets.

turbomam avatar turbomam commented on May 27, 2024

closed by #24

from schemasheets.

turbomam avatar turbomam commented on May 27, 2024

Could improve PR with a test instead of an example in the Makefile

from schemasheets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.