Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/pyspark/sql/tests/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ def test_convert(self):
result = PandasToArrowConversion.convert(df, schema)
self.assertEqual(result.num_rows, 0)

# Empty schema (0 columns)
# TODO(SPARK-55350): Pandas - > PyArrow should preserve row count with 0 columns. It is a bug.
# Empty schema (0 columns) should preserve row count
df = pd.DataFrame({"a": [1, 2, 3], "b": [4.0, 5.0, 6.0]})
result = PandasToArrowConversion.convert(df, StructType([]))
self.assertEqual(result.num_columns, 0)
self.assertEqual(result.num_rows, 0)
self.assertEqual(result.num_rows, 3)

def test_convert_assign_cols_by_name(self):
"""Test assign_cols_by_name reorders columns to match schema."""
Expand Down