Skip to content

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

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

Closed
DataBoyTX opened this issue Dec 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@DataBoyTX
Copy link

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

@DataBoyTX DataBoyTX added the enhancement New feature or request label Dec 12, 2023
@jaidisido
Copy link
Contributor

The pandas map API on a data frame was only introduced in pandas 2.1 pandas-dev/pandas#52353
So replacing it would cause backward compatibility. Perhaps we can consider suppressing the warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants