Skip to content

Conversation

@cthoyt
Copy link
Member

@cthoyt cthoyt commented Nov 25, 2025

Since pandas implements missing values as floats, this can give exceptions like

Traceback (most recent call last):
  File "/Users/cthoyt/.virtualenvs/biopragmatics/bin/biomappings", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/cthoyt/.virtualenvs/biopragmatics/lib/python3.14/site-packages/click/core.py", line 1462, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/cthoyt/.virtualenvs/biopragmatics/lib/python3.14/site-packages/click/core.py", line 1383, in main
    rv = self.invoke(ctx)
  File "/Users/cthoyt/.virtualenvs/biopragmatics/lib/python3.14/site-packages/click/core.py", line 1850, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/cthoyt/.virtualenvs/biopragmatics/lib/python3.14/site-packages/click/core.py", line 1246, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthoyt/.virtualenvs/biopragmatics/lib/python3.14/site-packages/click/core.py", line 814, in invoke
    return callback(*args, **kwargs)
  File "/Users/cthoyt/.virtualenvs/biopragmatics/lib/python3.14/site-packages/click/decorators.py", line 46, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Users/cthoyt/dev/sssom-curator/src/sssom_curator/repository.py", line 458, in main
    merge(obj, directory=sssom_directory)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthoyt/dev/sssom-curator/src/sssom_curator/export/merge.py", line 90, in merge
    write_owl(msdf, file)
    ~~~~~~~~~^^^^^^^^^^^^
  File "/Users/cthoyt/dev/sssom-py/src/sssom/writers.py", line 235, in write_owl
    graph = to_owl_graph(msdf)
  File "/Users/cthoyt/dev/sssom-py/src/sssom/writers.py", line 280, in to_owl_graph
    graph = to_rdf_graph(msdf=msdf)
  File "/Users/cthoyt/dev/sssom-py/src/sssom/writers.py", line 374, in to_rdf_graph
    return MappingSetRDFConverter(hydrate=hydrate, ccp=msdf.converter).msdf_to_rdf(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        msdf, hydrate=hydrate
        ^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/cthoyt/dev/sssom-py/src/sssom/rdf_internal.py", line 879, in msdf_to_rdf
    self._mapping_to_rdf(graph, ms_node, row, hydrate)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthoyt/dev/sssom-py/src/sssom/rdf_internal.py", line 915, in _mapping_to_rdf
    mapping_node = self.mapping_converter.dict_to_rdf(graph, mapping)
  File "/Users/cthoyt/dev/sssom-py/src/sssom/rdf_internal.py", line 583, in dict_to_rdf
    for value in self._get_multi_values(v):
                 ~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/Users/cthoyt/dev/sssom-py/src/sssom/rdf_internal.py", line 974, in _get_multi_values
    return cast(List[Any], value.split("|"))
                           ^^^^^^^^^^^
AttributeError: 'float' object has no attribute 'split'

i have to put more time to understand how all these calls are made so I can write a unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants