From c8094e7dd66880b31d6cf375b6f9bbe89adbb368 Mon Sep 17 00:00:00 2001 From: venikkus Date: Fri, 18 Oct 2024 19:19:52 +0300 Subject: [PATCH] Delete exception from pandas frame --- pandas/core/frame.py | 8 ++++---- pandas/tests/frame/test_constructors.py | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index afcd4d014316e..204c0c1011f23 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -738,10 +738,10 @@ def __init__( original_dtype = dtype # GH47215 - if isinstance(index, set): - raise ValueError("index cannot be a set") - if isinstance(columns, set): - raise ValueError("columns cannot be a set") + # if isinstance(index, set): + # raise ValueError("index cannot be a set") + # if isinstance(columns, set): + # raise ValueError("columns cannot be a set") if copy is None: if isinstance(data, dict): diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index cae2f6e81d384..92691ecba93ee 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -3111,13 +3111,13 @@ def test_construction_from_ndarray_with_eadtype_mismatched_columns(self): with pytest.raises(ValueError, match=msg): DataFrame(arr2, columns=["foo", "bar"]) - def test_columns_indexes_raise_on_sets(self): + # def test_columns_indexes_raise_on_sets(self): # GH 47215 - data = [[1, 2, 3], [4, 5, 6]] - with pytest.raises(ValueError, match="index cannot be a set"): - DataFrame(data, index={"a", "b"}) - with pytest.raises(ValueError, match="columns cannot be a set"): - DataFrame(data, columns={"a", "b", "c"}) + # data = [[1, 2, 3], [4, 5, 6]] + # with pytest.raises(ValueError, match="index cannot be a set"): + # DataFrame(data, index={"a", "b"}) + # with pytest.raises(ValueError, match="columns cannot be a set"): + # DataFrame(data, columns={"a", "b", "c"}) # TODO: make this not cast to object in pandas 3.0 @pytest.mark.skipif(