Skip to content

Neptune to_property_graph() fails when value doesn't exist for a column #1232

@bechbd

Description

@bechbd

Describe the bug

When writing data or updates to a property graph the operation fails due to a poorly formed Gremlin query whenever the input dataframe has columns that are not filled in.

QueryFailed: 499: {"detailedMessage":"Failed to interpret Gremlin query: Query parsing failed at line 1, character position at 62, error message : token recognition error at: 'na'","requestId":"f7ff57d1-7816-4670-ba68-0d6684951a3d","code":"MalformedQueryException"}

How to Reproduce

    data = [{"~id": id, "age": 50, "name": "foo"}, {"~id": id, "age": 55}]
    df = pd.DataFrame(data)
    res = wr.neptune.to_property_graph(client, df)
    res = wr.neptune.execute_gremlin(client, f"g.V('{id}').valueMap().with(WithOptions.tokens)")

Expected behavior

The query should ignore any data fields that are NA

Your project

No response

Screenshots

No response

OS

Any

Python version

Any

AWS DataWrangler version

Main

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions