Expand support for non-str dtype("O")
in pandas type system
#258
Labels
enhancement
New feature or request
dtype("O")
in pandas type system
#258
Is your feature request related to a problem? Please describe.
#257 adds support for
numpy
andpandas
TypeSystems, but when converting from a pandas value to the artigraphType
(ie:to_artigraph
), series withdtype("O")
must be strings despite pandas supporting arbitrary objects. This prevents using complex types as cell values, for example:The
to_system
direction should work better since we know the spec of the cell values, but I think there's an issue or two in how we instantiate/handle them that should be pretty easy to fix.Describe the solution you'd like
We should expand the type conversions to support more structured types like
list[str]
,dict[str, int]
, etc. We can't support every python object, but should try to handle those that could be represented as thearti.types
and would reasonably be serialized (to json, parquet, etc).The implementation would likely require some inspection to try and infer a python type hint from the values. Perhaps we can try to construct the type hint and then pass off to
python_type_system
?Describe alternatives you've considered
We could require a
hint
filling in any metadata, but this would be less user friendly and not always easy to specify.Additional context
Current errors cases:
The text was updated successfully, but these errors were encountered: