Skip to content

Commit 1251f44

Browse files
committed
Write unit test
1 parent 8276725 commit 1251f44

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

datafusion/tests/test_dataframe.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,3 +533,14 @@ def test_cache(df):
533533
def test_count(df):
534534
# Get number of rows
535535
assert df.count() == 3
536+
537+
538+
def test_to_pandas(df):
539+
# Skip test if pandas is not installed
540+
pd = pytest.importorskip("pandas")
541+
542+
# Convert datafusion dataframe to pandas dataframe
543+
pandas_df = df.to_pandas()
544+
assert type(pandas_df) == pd.DataFrame
545+
assert pandas_df.shape == (3, 3)
546+
assert set(pandas_df.columns) == {"a", "b", "c"}

0 commit comments

Comments
 (0)