Skip to content
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

Adds properties on edges #306

Merged
merged 5 commits into from
Jul 5, 2024
Merged

Adds properties on edges #306

merged 5 commits into from
Jul 5, 2024

Conversation

andrejtonev
Copy link
Contributor

@andrejtonev andrejtonev commented Feb 28, 2024

Define relationship properties in many_to_many via name_mappings and properties field

Copy link
Contributor

@antepusic antepusic left a comment

Choose a reason for hiding this comment

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

The code looks fine. Can you add a test to serve as an example and verify that this feature works?

@andrejtonev andrejtonev changed the base branch from main to develop February 29, 2024 09:32
@andrejtonev
Copy link
Contributor Author

@antepusic I changed the code a bit. Had some CI problems, not sure why it didn't like the first version...

@andrejtonev andrejtonev changed the base branch from develop to main February 29, 2024 13:45
@andrejtonev andrejtonev changed the base branch from main to develop February 29, 2024 14:16
@andrejtonev andrejtonev added Docs needed Docs needed feature feature labels Feb 29, 2024
@katarinasupe katarinasupe added this to the v1.6.0 milestone Jun 5, 2024
@katarinasupe
Copy link
Contributor

Related docs:

@katarinasupe
Copy link
Contributor

katarinasupe commented Jun 24, 2024

Hi @andrejtonev, the related how to guide needs to be properly updated (reference guide is automated), and you should rebase to main. We no longer use the develop branch for the release; everything goes directly to the main.

FYI, as discussed, this will be included in the next release (July 10th). Work on Memgraph is a priority, so we can move the milestone due date if you can't make it.

@andrejtonev andrejtonev changed the base branch from develop to main June 24, 2024 11:57
@andrejtonev andrejtonev force-pushed the properties_on_edges branch 2 times, most recently from 0db37f2 to 01bfcd6 Compare June 24, 2024 12:17
@andrejtonev
Copy link
Contributor Author

andrejtonev commented Jun 24, 2024

one_to_many: passing field parameters (which already existed but was not used) many_to_many: changed from parameters to column_names_mapping
using the mapping and columns to define properties
ignoring from to keys when adding properties

Description

Responding to user-made issue. Requesting the ability to define properties on edges.
Something similar was already present, but was not used and needed to be expanded to support mappings.
Mappings are only supported for many_to_many
one_to_many only supports predefined and fixed parameters defined via the configuration file.

Pull request type

Please delete options that are not relevant.

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring with functional or API changes
  • Refactoring without functional or API changes
  • Build or packaging related changes
  • Documentation content changes
  • Other (please describe):

Related issues

Delete section if this PR doesn't resolve any issues.

Closes #301

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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

Reviewer checklist (the reviewer checks this part)

  • Core feature implementation
  • Tests
  • Code documentation
  • Documentation on gqlalchemy/docs

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

@andrejtonev
Copy link
Contributor Author

Do not merge
Need to update implementation.

  1. Use name mappings instead of a local column name map.
  2. Figure out how/if to implement one_to_many edge parameters Remove one_to_many edge parameters. We cannot add information not present in one of the nodes (edge created via node creation triggers). We could add a fixed param, but I just don't see a good use-case at the moment.

@andrejtonev
Copy link
Contributor Author

@antepusic @Josipmrden I didn't like my previous implementation. Made a few changes. Please take another look
Thanks

Copy link
Contributor

@antepusic antepusic left a comment

Choose a reason for hiding this comment

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

The changes make sense, well done! Just make sure that the checks pass (formatting & two tests) before we may merge

@andrejtonev
Copy link
Contributor Author

@katarinasupe I updated the relevant docs.
Changed the example for the one_to_many and added one for many_to_many.

@katarinasupe
Copy link
Contributor

@andrejtonev Merge the latest main for tests to pass.
Once the tests pass, feel free to squash and merge.

@katarinasupe katarinasupe self-requested a review July 4, 2024 13:17
one_to_many: passing field parameters (which already existed but was not used)
many_to_many: changed from parameters to column_names_mapping
	      using the mapping and columns to define properties
	      ignoring from to keys when adding properties
@andrejtonev andrejtonev merged commit 651240c into main Jul 5, 2024
5 checks passed
@katarinasupe katarinasupe linked an issue Jul 10, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs needed Docs needed feature feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Please allow add edge properties in Loaders
4 participants