Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

[E-node < T501] Implement node.relationship_types - #300

Merged
imilinovic merged 3 commits into
E-add-node-functionsfrom
T501-MAGE-relationship-types
Aug 11, 2023
Merged

[E-node < T501] Implement node.relationship_types#300
imilinovic merged 3 commits into
E-add-node-functionsfrom
T501-MAGE-relationship-types

Conversation

@imilinovic

Copy link
Copy Markdown
Contributor

Description

Implement node.relationship_types

Pull request type

  • Bugfix
  • Algorithm/Module
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

######################################

Reviewer checklist (the reviewer checks this part)

Module/Algorithm

######################################

@imilinovic imilinovic self-assigned this Aug 8, 2023
@imilinovic imilinovic added the status: ready PR is ready for review label Aug 8, 2023

@antepusic antepusic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but I'd like to see two things addressed before approving:

  • the difference in function signature between us and APOC
  • if the user gives e.g. "" as a relationship type, that should be handled appropriately

Comment thread cpp/node_module/node_module.cpp
Comment on lines +12 to +18
if (type.starts_with('<')) {
result[type.substr(1, type.size() - 1)] |= 1;
} else if (type.ends_with('>')) {
result[type.substr(0, type.size() - 1)] |= 2;
} else {
result[type] |= 3;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case where type both starts with '<' and ends with '>' (e.g. '') should also be addressed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We internally discussed it and decided that <> case isn't needed because it it is just like without the <> (since it covers both in and out nodes). Will discuss tomorrow on daily to either throw error or allow it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked that and you're right about it 😄. However, if the user gives e.g. "<KNOWS>", the current code would treat that like "<KNOWS" and not "KNOWS".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, we already said to throw an error. Fixed

@imilinovic imilinovic added status: draft PR is in draft phase and removed status: ready PR is ready for review labels Aug 10, 2023

@antepusic antepusic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification about procedure signature. I think this is good to go now 🚀

@antepusic antepusic mentioned this pull request Aug 10, 2023
16 tasks
@imilinovic
imilinovic merged commit 5c3a117 into E-add-node-functions Aug 11, 2023
@imilinovic
imilinovic deleted the T501-MAGE-relationship-types branch August 11, 2023 07:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

status: draft PR is in draft phase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants