-
Notifications
You must be signed in to change notification settings - Fork 8
Slim down integrations api for pandas and gds #236
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Nicola Vitucci <[email protected]>
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.
Pull Request Overview
This PR simplifies the integration APIs for pandas and GDS by removing automatic node sizing and property-to-field mapping capabilities. Instead of configuring these features through function parameters, users now configure them directly on the VisualizationGraph object after creation.
Key Changes:
- Removed
node_radius_min_maxparameter fromfrom_dfs,from_gds, andfrom_snowflakefunctions - Renamed
additional_node_propertiestonode_propertiesandadditional_db_node_propertiestodb_node_propertiesinfrom_gds - Changed integration functions to only map basic fields (id, caption, source, target) instead of all matching field names
- Added automatic node coloring by label in
from_gds
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python-wrapper/tests/test_pandas.py | Updated tests to remove node_radius_min_max parameter and validate nodes store size/color in properties instead of fields |
| python-wrapper/tests/test_gds.py | Removed tests for automatic sizing and validation, updated assertions to include color field, renamed parameter references |
| python-wrapper/src/neo4j_viz/visualization_graph.py | Added comprehensive documentation with examples for VisualizationGraph class and constructor |
| python-wrapper/src/neo4j_viz/snowflake.py | Removed node_radius_min_max parameter and updated documentation |
| python-wrapper/src/neo4j_viz/relationship.py | Added basic_fields_validation_aliases() helper method |
| python-wrapper/src/neo4j_viz/pandas.py | Removed sizing logic and property renaming, changed to only map basic fields as mandatory fields instead of all matching aliases |
| python-wrapper/src/neo4j_viz/node.py | Added basic_fields_validation_aliases() helper method |
| python-wrapper/src/neo4j_viz/gds.py | Removed size property mapping and added automatic node coloring, renamed parameters |
| docs/source/integration.rst | Updated documentation to reflect API changes and new usage patterns |
| docs/source/conf.py | Added sphinx configuration for documentation rendering |
| changelog.md | Documented breaking changes and parameter renames |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| - fixed a bug in `from_neo4j`, where the node size would always be set to the `size` property. | ||
| - fixed a bug in `from_neo4j`, where the node caption would always be set to the `caption` property. | ||
| - Color nodes in `from_snowflake` only if there are less than 13 node tables used. This avoids reuse of colors for different tables. |
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.
This doesn't quite seem like a bugfix? Just a change? Should we have the same color behaviour for the other constructors then too?
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.
yes i would suggest to have the same coloring behavior in neo4j and gql. i added it to gds in this PR.
Will do on a follow up PR
| In this small example, we import a graph projection from the GDS library, that has the node properties "pagerank" and | ||
| "componentId". | ||
| We use the "pagerank" property to determine the size of the nodes, and the "componentId" property to color the nodes. | ||
| We use the "pagerank" property to set the size of the nodes, and the "componentId" property to color the nodes. |
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.
My preference:
| We use the "pagerank" property to set the size of the nodes, and the "componentId" property to color the nodes. | |
| We use the "pagerank" property to compute the size of the nodes, and the "componentId" property to color the nodes. |
|
|
||
| - Validate fields of a node and relationship not only at construction but also on assignment. | ||
| - Allow resizing per node property such as `VG.resize_nodes(property="score")`. | ||
| - Color nodes by label in `fom_gds`. |
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.
| - Color nodes by label in `fom_gds`. | |
| - Color nodes by label in `from_gds`. |
| * the caption of a node will be based on its `labels` property. | ||
| * the caption of a relationship will be based on its `relationshipType` property. |
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.
I wonder if it's confusing to talk about properties here since they're not actually properties in the GDS sense
| * `id`, and `caption` for the node_dfs | ||
| * `id`, `source`, `target`, `caption` for the rel_dfs |
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.
Why do we have caption here? Since it's not mandatory I mean. None of the other constructors behave this way?
| """ | ||
| A graph to visualize. | ||
| The `VisualizationGraph` class represents a collection of nodes and relationships that can be |
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.
🎉
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.
Looks great, nice work! Just added some minor comments/questions
No description provided.