-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test and changes for a relationship identifier migration #5652
Conversation
CodSpeed Performance ReportMerging #5652 will not alter performanceComparing Summary
|
82066c0
to
a842562
Compare
path_type = ( | ||
PathType.RELATIONSHIP_ONE | ||
if relationship_schema.cardinality is RelationshipCardinality.ONE | ||
if relationship.cardinality is RelationshipCardinality.ONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we used to have to get the cardinality of a relationship from the schema, but now we save it on the diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PathType has a .from_relationship() method that would be a bit cleaner to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice. updated
relationship_schema = node_schema.get_relationship_or_none(name=relationship_diff.name) | ||
if not relationship_schema and alternate_node_schema: | ||
relationship_schema = alternate_node_schema.get_relationship_or_none(name=relationship_diff.name) | ||
relationship_diff.label = relationship_schema.label or "" if relationship_schema else "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes are required to handle the case when a relationship name is updated
possible_path_directions = database_path.possible_relationship_directions | ||
for rel_schema in relationship_schemas: | ||
if rel_schema.direction in possible_path_directions: | ||
return rel_schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to use both the relationship name and identifier for uniqueness because...
- an identifier is not unique if the schema has two different relationships for inbound/outbound with the same identifier, like in the case of
parent
andchildren
in a hierarchy - a name is not unique if the relationship has been renamed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a minor comment as well as a question about the SDK commit.
path_type = ( | ||
PathType.RELATIONSHIP_ONE | ||
if relationship_schema.cardinality is RelationshipCardinality.ONE | ||
if relationship.cardinality is RelationshipCardinality.ONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PathType has a .from_relationship() method that would be a bit cleaner to use.
python_sdk
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the update of the python_sdk commit intentional or by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidental. will revert it
1b7aa6b
to
8ebb56a
Compare
IFC-1202
add tests for the diff calculation logic when handling an attribute name migration or a relationship identifier migration.
update the diff calculation logic to correctly handle a relationship identifier migration. this required using the relationship's identifier instead of its name for determining uniqueness