Skip to content

Make rel_dfs of from_dfs optional#190

Merged
adamnsch merged 1 commit intomainfrom
rel-dfs-optional
Jul 1, 2025
Merged

Make rel_dfs of from_dfs optional#190
adamnsch merged 1 commit intomainfrom
rel-dfs-optional

Conversation

@adamnsch
Copy link
Collaborator

@adamnsch adamnsch commented Jun 27, 2025

Thank you for your contribution to the Graph Visualization for Python project by Neo4j.

Before submitting this PR, please read Contributing to the Neo4j Ecosystem.

Make sure:

  • You signed the Neo4j CLA (Contributor License Agreement) so that we are allowed to ship your code in our library
  • Your contribution is covered by tests

Based on #189

Comment on lines +79 to +80
if dropna:
row.dropna(inplace=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT could move the dropna logic into the k,v loop below (line 83).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I understand :) You mean we check each value if it's NaN? If so this feels a bit cleaner I think

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes :)

with this you mean the row.dropna?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think only making one call to row.dropna feels nicer than checking every value of the row

Copy link
Collaborator

@FlorentinD FlorentinD left a comment

Choose a reason for hiding this comment

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

Great improvement :)

We could also allow node_dfs to have the shape of dict[str, DataFrame].
This might make the drop_na option not as relevant? (gds could pass a df per label)

@adamnsch
Copy link
Collaborator Author

Great improvement :)

We could also allow node_dfs to have the shape of dict[str, DataFrame]. This might make the drop_na option not as relevant? (gds could pass a df per label)

I don't think that matters, since GDS can already pass a list of dataframes, one for each label. We could also remove dropna from the API, as long as we have in the internal _from_dfs that's enough for us

@adamnsch adamnsch force-pushed the rel-dfs-optional branch from 53ec414 to 44f59c1 Compare July 1, 2025 10:13
@adamnsch adamnsch merged commit 11708ee into main Jul 1, 2025
10 checks passed
@adamnsch adamnsch deleted the rel-dfs-optional branch July 1, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants