Skip to content

flatten_nested_df: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. #2554

Closed
@DataBoyTX

Description

@DataBoyTX

Is your idea related to a problem? Please describe.
when I call wr.neptune.flatten_nested_df() I get the following warning printed for each record:

/root/.local/lib/python3.10/site-packages/awswrangler/neptune/_neptune.py:624: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
  s = (df.applymap(type) == list).all()

sample code:

query = f"MATCH (n:person) RETURN n.name"
df0 = wr.neptune.execute_opencypher(client, query)
if len(df0) == 0: 
    print("no nodes") 
else:
    df1 = wr.neptune.flatten_nested_df(df0)
    display(df1)

Describe the solution you'd like
update the applymap to map to avoid the warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions