From d64de13c90d6d714070e5f52a96f55a14a6516ea Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sun, 3 Mar 2024 12:40:44 -0700 Subject: [PATCH] fix test failures --- datafusion/tests/test_dataframe.py | 6 +++--- datafusion/tests/test_substrait.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datafusion/tests/test_dataframe.py b/datafusion/tests/test_dataframe.py index c80653cc..9944abee 100644 --- a/datafusion/tests/test_dataframe.py +++ b/datafusion/tests/test_dataframe.py @@ -415,7 +415,7 @@ def test_execution_plan(aggregate_df): assert expected == plan.display() # Check the number of partitions is as expected. - assert isinstance(type(plan.partition_count), int) + assert isinstance(plan.partition_count, int) expected = ( "ProjectionExec: expr=[c1@0 as c1, SUM(test.c2)@1 as SUM(test.c2)]\n" @@ -634,7 +634,7 @@ def test_empty_to_arrow_table(df): def test_to_pylist(df): # Convert datafusion dataframe to Python list pylist = df.to_pylist() - assert isinstance(type(pylist), list) + assert isinstance(pylist, list) assert pylist == [ {"a": 1, "b": 4, "c": 8}, {"a": 2, "b": 5, "c": 5}, @@ -645,7 +645,7 @@ def test_to_pylist(df): def test_to_pydict(df): # Convert datafusion dataframe to Python dictionary pydict = df.to_pydict() - assert isinstance(type(pydict), dict) + assert isinstance(pydict, dict) assert pydict == {"a": [1, 2, 3], "b": [4, 5, 6], "c": [8, 5, 8]} diff --git a/datafusion/tests/test_substrait.py b/datafusion/tests/test_substrait.py index b8f6834b..62f6413a 100644 --- a/datafusion/tests/test_substrait.py +++ b/datafusion/tests/test_substrait.py @@ -40,7 +40,7 @@ def test_substrait_serialization(ctx): # For now just make sure the method calls blow up substrait_plan = ss.substrait.serde.serialize_to_plan("SELECT * FROM t", ctx) substrait_bytes = substrait_plan.encode() - assert isinstance(type(substrait_bytes), bytes) + assert isinstance(substrait_bytes, bytes) substrait_bytes = ss.substrait.serde.serialize_bytes("SELECT * FROM t", ctx) substrait_plan = ss.substrait.serde.deserialize_bytes(substrait_bytes) logical_plan = ss.substrait.consumer.from_substrait_plan(ctx, substrait_plan)