Skip to content

Commit 5dcc1ac

Browse files
committed
All reviews are updated.Please check
1 parent 81ad960 commit 5dcc1ac

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

pandas/core/frame_test_constructors.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

pandas/tests/frame/constructors/test_from_records.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,3 +492,11 @@ def test_from_records_structured_array(self):
492492
expected_result = DataFrame(modified_data)
493493

494494
tm.assert_frame_equal(actual_result, expected_result)
495+
496+
497+
def test_from_records_empty_iterator_with_preserve_columns(self):
498+
# GH#61140
499+
rows = []
500+
result = DataFrame.from_records(iter(rows), columns=["col_1", "Col_2"], nrows=0)
501+
expected = DataFrame([],columns=["col_1", "Col_2"])
502+
tm.assert_frame_equal(result, expected)

pandas/tests/frame/test_constructors.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,13 +2779,7 @@ def test_construction_nan_value_timedelta64_dtype(self):
27792779
["NaT", "0 days 00:00:00.000000001"], dtype="timedelta64[ns]"
27802780
)
27812781
tm.assert_frame_equal(result, expected)
2782-
2783-
def test_from_records_empty_iterator_with_preserve_columns(self):
2784-
2785-
rows = []
2786-
df = pd.DataFrame.from_records(iter(rows), columns=["col_1", "Col_2"], nrows=0)
2787-
assert list(df.columns) == ["col_1", "Col_2"]
2788-
assert len(df) == 0
2782+
27892783

27902784
class TestDataFrameConstructorIndexInference:
27912785
def test_frame_from_dict_of_series_overlapping_monthly_period_indexes(self):

0 commit comments

Comments
 (0)