neo4j-contrib / neomodel

An Object Graph Mapper (OGM) for the Neo4j graph database.
https://neomodel.readthedocs.io
MIT License
936 stars 231 forks source link

Respect db_property attribute in relationships and semi-structured nodes #776

Closed j-krose closed 4 months ago

j-krose commented 8 months ago

Fixes https://github.com/neo4j-contrib/neomodel/issues/774 by centralizing inflate functionality in order to respect db_property attribute in both StructuredRelationship and SemiStructuredNode.

Added necessary tests for both StructuredRelationship and SemiStructuredNode, as well as tests for InflateConflict and DeflateConflict.

sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

j-krose commented 7 months ago

@mariusconjeaud is there someone I should ping to take a look at this PR?

mariusconjeaud commented 4 months ago

@j-krose sorry, I was away the whole of January ; then when I came back, I was in the depth implement async for neomodel, and it took all my attention.

I have started reviewing the new PRs, and will review yours asap !

mariusconjeaud commented 4 months ago

@j-krose Tested with the new async code (merged in rc/5.3.0) and it works fine.

So I will merge this into a temp branch (rc/5.3.0-pre), so I can merge it back into the actual release candidate branch. This is because I otherwise need to just copy paste your code as the async and sync codebases are now split, and you wouldn't be seen as a contributor anywhere :-)

Note : I had to comment out three lines in your new test test_independent_property_name_for_semi_structured ; for some reason, it works in async, but fails in sync. Basically, the results returned by sync db.cypher_query contain both properties as defined in class and dbproperty (e.g. title and `title`). Let me merge this now with those three lines commented out, then we can check and make a fix PR ; better than letting it stew until I understand what is happening exactly.

Thanks for the great work, and for your help in making the code cleaner, adding docstrings, and writing tests for it !