|
28 | 28 | # The dictionary keys represent column names and the dictionary values |
29 | 29 | # represent column values |
30 | 30 | df = ctx.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6]}) |
31 | | -assert type(df) == datafusion.DataFrame |
| 31 | +assert type(df) is datafusion.DataFrame |
32 | 32 | # Dataframe: |
33 | 33 | # +---+---+ |
34 | 34 | # | a | b | |
|
40 | 40 |
|
41 | 41 | # Create a datafusion DataFrame from a Python list of rows |
42 | 42 | df = ctx.from_pylist([{"a": 1, "b": 4}, {"a": 2, "b": 5}, {"a": 3, "b": 6}]) |
43 | | -assert type(df) == datafusion.DataFrame |
| 43 | +assert type(df) is datafusion.DataFrame |
44 | 44 |
|
45 | 45 | # Convert pandas DataFrame to datafusion DataFrame |
46 | 46 | pandas_df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}) |
47 | 47 | df = ctx.from_pandas(pandas_df) |
48 | | -assert type(df) == datafusion.DataFrame |
| 48 | +assert type(df) is datafusion.DataFrame |
49 | 49 |
|
50 | 50 | # Convert polars DataFrame to datafusion DataFrame |
51 | 51 | polars_df = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}) |
52 | 52 | df = ctx.from_polars(polars_df) |
53 | | -assert type(df) == datafusion.DataFrame |
| 53 | +assert type(df) is datafusion.DataFrame |
54 | 54 |
|
55 | 55 | # Convert Arrow Table to datafusion DataFrame |
56 | 56 | arrow_table = pa.Table.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6]}) |
57 | 57 | df = ctx.from_arrow(arrow_table) |
58 | | -assert type(df) == datafusion.DataFrame |
| 58 | +assert type(df) is datafusion.DataFrame |
0 commit comments