Skip to content

Commit 6f02f34

Browse files
authored
Ignore DeprecationWarning Emitted From pyarrow/pandas (#1892)
* Ignore `DeprecationWarning` emitted from pyarrow/pandas in pytest.ini * Replace built-in chained assignment with `loc`
1 parent 3221954 commit 6f02f34

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ filterwarnings = [
1212
"error",
1313
"default::pytest.PytestWarning",
1414
"default::DeprecationWarning:distributed",
15+
# Pyarrow emits a warning regarding use of deprecated Pandas function
16+
# Remove this once we bump Pyarrow version
17+
"ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning"
1518
]
1619

1720
[tool.ruff]

tiledb/tests/test_pandas_dataframe.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def test_dataframe_fillna(self):
569569
tm.assert_frame_equal(df, df_copy)
570570

571571
# update the value in the original dataframe to match what we expect on read-back
572-
df["v"][4] = -1
572+
df.loc[4] = -1
573573
df_bk = tiledb.open_dataframe(uri)
574574
tm.assert_frame_equal(df_bk, df)
575575

@@ -941,7 +941,7 @@ def test_csv_fillna(self):
941941

942942
def check_array(path, df):
943943
# update the value in the original dataframe to match what we expect on read-back
944-
df["v"][4] = 0
944+
df.loc[4] = 0
945945

946946
df_bk = tiledb.open_dataframe(path)
947947
tm.assert_frame_equal(df_bk, df)
@@ -969,7 +969,7 @@ def check_array(path, df):
969969
# Test roundtrip a Int64Dtype in newer pandas versions
970970
tmp_csv2 = os.path.join(tmp_dir, "generated.csv")
971971
df2 = pd.DataFrame({"v": pd.Series(np.int64(df["v"]), dtype=pd.Int64Dtype())})
972-
df2["v"][4] = None
972+
df2.loc[4] = None
973973

974974
with tiledb.FileIO(self.vfs, tmp_csv2, "wb") as fio:
975975
df2.to_csv(fio, index=False)

0 commit comments

Comments
 (0)