|
22 | 22 | import pyarrow as pa # type: ignore |
23 | 23 | import pytest |
24 | 24 |
|
| 25 | +import bigframes.dataframe as dataframe |
25 | 26 | import bigframes.pandas |
26 | 27 | import bigframes.series as series |
27 | 28 | from tests.system.utils import assert_pandas_df_equal, assert_series_equal |
@@ -2266,6 +2267,30 @@ def test_dot(scalars_dfs): |
2266 | 2267 | assert bf_result == pd_result |
2267 | 2268 |
|
2268 | 2269 |
|
| 2270 | +def test_dot_df(scalars_dfs): |
| 2271 | + scalars_df, scalars_pandas_df = scalars_dfs |
| 2272 | + bf_result = scalars_df["int64_too"] @ scalars_df[["int64_col", "int64_too"]] |
| 2273 | + pd_result = ( |
| 2274 | + scalars_pandas_df["int64_too"] @ scalars_pandas_df[["int64_col", "int64_too"]] |
| 2275 | + ) |
| 2276 | + |
| 2277 | + pd.testing.assert_series_equal( |
| 2278 | + bf_result.to_pandas(), pd_result, check_index_type=False, check_dtype=False |
| 2279 | + ) |
| 2280 | + |
| 2281 | + |
| 2282 | +def test_dot_df_inline(scalars_dfs): |
| 2283 | + left = [10, 11, 12, 13] # series data |
| 2284 | + right = [[0, 1], [-2, 3], [4, -5], [6, 7]] # dataframe data |
| 2285 | + |
| 2286 | + bf_result = series.Series(left) @ dataframe.DataFrame(right) |
| 2287 | + pd_result = pd.Series(left) @ pd.DataFrame(right) |
| 2288 | + |
| 2289 | + pd.testing.assert_series_equal( |
| 2290 | + bf_result.to_pandas(), pd_result, check_index_type=False, check_dtype=False |
| 2291 | + ) |
| 2292 | + |
| 2293 | + |
2269 | 2294 | @pytest.mark.parametrize( |
2270 | 2295 | ("left", "right", "inclusive"), |
2271 | 2296 | [ |
|
0 commit comments