nodestream-proj / nodestream

A Declarative framework for Building, Maintaining, and Analyzing Graph Data
https://nodestream-proj.github.io/docs/
Apache License 2.0
37 stars 11 forks source link

[BUG] Node key cannot be composed from properties of differing types #274

Closed Cole-Greer closed 7 months ago

Cole-Greer commented 7 months ago

Describe the bug When attempting to compose a node key from properties of differing types, nodestream will attempt to sort all key values which will throw an exception if the value types are not comparable.

To Reproduce Steps to reproduce the behavior:

  1. Create an interpretation which creates a node key with different datatypes, for example:
    interpretations:
      - type: source_node
        node_type: Person
        key:
          name: John
          age: 23
  2. When running the pipeline, an error such as this will be raised:
    TypeError: '<' not supported between instances of 'int' and 'str'

    The source of this error is https://github.com/nodestream-proj/nodestream/blob/7254d8e109270065e609b1da97aa1db2bcfffa61/nodestream/model/graph_objects.py#L115

Expected behavior Nodestream should be able to construct a key of mixed types.

zprobst commented 7 months ago

@Cole-Greer thanks for the catch... we'll take a look at this one.

zprobst commented 7 months ago

This is covered by #275 which will be released with 0.12