You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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?
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
I agree. Any clear exception would be good for this. The customer can always catch and eat it if they have zero-record updates as part of their workflow (or check the count prior to calling). The current exception is essentially the equivalent to NullPointerException in the Gremlin driver.
From: jaidisido ***@***.***>
Sent: Thursday, November 16, 2023 11:43 AM
To: aws/aws-sdk-pandas ***@***.***>
Cc: O'Keefe, Brian ***@***.***>; Mention ***@***.***>
Subject: Re: [aws/aws-sdk-pandas] Neptune to_property_graph errors if the DataFrame is empty (Issue #2517)
I would be in favour of raising an EmptyDataFrame<https://github.com/aws/aws-sdk-pandas/blob/main/awswrangler/exceptions.py#L60> 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
—
Reply to this email directly, view it on GitHub<#2517 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARDUYOVDGGDXUKNHE5GK5B3YEY7CPAVCNFSM6AAAAAA7JH4XCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUHAZDKOJRGI>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
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
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
The text was updated successfully, but these errors were encountered: