Skip to content

Unsilenceable Index.format deprecation warning with pandas 2.2 #1537

@paulimer

Description

@paulimer

Using python 3.11, pandas 2.2 and reticulate 1.34 (the last one in conda), each time I send a dataframe to python (or one is returned, I can't tell), the following warning is displayed :
sys:1: FutureWarning: Index.format is deprecated and will be removed in a future version. Convert using index.astype(str) or index.map(formatter) instead.
It is not silenceable with py_suppress_warnings, and did not happen with pandas 2.1.4.

To reproduce the issue the following R code :

library(reticulate)
use_condaenv("warning")
warning <- import("warning")

iris_2 <- warning$test_df(iris)

python code :

import pandas as pd

def test_df(input_df):
    return input_df

and conda environment :

name: warning
channels:
    - bioconda
    - conda-forge
    - defaults
dependencies:
    - python=3.11
    - pandas=2.2
    - r-reticulate

is sufficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions