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

Neptune to_property_graph errors if the DataFrame is empty #2517

Closed
brianok-aws opened this issue Nov 13, 2023 · 4 comments
Closed

Neptune to_property_graph errors if the DataFrame is empty #2517

brianok-aws opened this issue Nov 13, 2023 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@brianok-aws
Copy link

Describe the bug

When writing a dataframe with zero records to Neptune using to_property_graph, an exception is thrown "Error during serialization: Serializer for type com.amazon.neptune.tinkerpop.structure.NeptuneGraph$NeptuneGraphTraversalSource not found"

How to Reproduce

*P.S. Please do not attach files as it's considered a security risk. Add code snippets directly in the message body as much as possible.*

Create a data frame with zero records and try to write it to Neptune using to_property_graph().

Expected behavior

Nothing will be written but an exception will not be thrown.

Your project

No response

Screenshots

No response

OS

Amazon Linux 2 (via Jupyter Notebook on Sagemaker)

Python version

3.10

AWS SDK for pandas version

3.4.1

Additional context

Related to #2494

@brianok-aws brianok-aws added the bug Something isn't working label Nov 13, 2023
@kukushking
Copy link
Contributor

Hi @brianok-aws we can certainly skip the operation and return if there are no rows in the property graph df. Do you foresee any cases where user/client code would like to know they are trying to insert something that does not make sense?

@jaidisido
Copy link
Contributor

I would be in favour of raising an EmptyDataFrame Exception rather than failing silently. Users should realise that their df is empty and they catch the exception on their own if they wish to ignore it

@brianok-aws
Copy link
Author

brianok-aws commented Nov 16, 2023 via email

@kukushking kukushking added this to the 3.5.0 milestone Nov 21, 2023
@kukushking kukushking self-assigned this Nov 21, 2023
@kukushking
Copy link
Contributor

Fixed in #2526.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants