From 1dbb31511e2a87e369d77e2219bca7e6aec0b167 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:40:28 -0400 Subject: [PATCH 1/2] COMPAT: Update code for Cython 3.0b2 --- .github/workflows/ubuntu.yml | 2 +- pandas/_libs/join.pyx | 14 ++------------ pandas/core/reshape/merge.py | 8 +------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f990c6edaeb2a..2ea43b6b7e94f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -74,7 +74,7 @@ jobs: test_args: "-W error::DeprecationWarning -W error::FutureWarning" # TODO(cython3): Re-enable once next-beta(after beta 1) comes out # There are some warnings failing the build with -werror - pandas_ci: "0" + #pandas_ci: "0" exclude: - env_file: actions-38.yaml pyarrow_version: "8" diff --git a/pandas/_libs/join.pyx b/pandas/_libs/join.pyx index 2b3b147470cef..c9e6223602480 100644 --- a/pandas/_libs/join.pyx +++ b/pandas/_libs/join.pyx @@ -850,17 +850,7 @@ def asof_join_nearest_on_X_by_Y(ndarray[numeric_t] left_values, numeric_t bdiff, fdiff # search both forward and backward - # TODO(cython3): - # Bug in beta1 preventing Cython from choosing - # right specialization when one fused memview is None - # Doesn't matter what type we choose - # (nothing happens anyways since it is None) - # GH 51640 - if left_by_values is not None and left_by_values.dtype != object: - by_dtype = f"{left_by_values.dtype}_t" - else: - by_dtype = object - bli, bri = asof_join_backward_on_X_by_Y[f"{left_values.dtype}_t", by_dtype]( + bli, bri = asof_join_backward_on_X_by_Y( left_values, right_values, left_by_values, @@ -869,7 +859,7 @@ def asof_join_nearest_on_X_by_Y(ndarray[numeric_t] left_values, tolerance, use_hashtable ) - fli, fri = asof_join_forward_on_X_by_Y[f"{left_values.dtype}_t", by_dtype]( + fli, fri = asof_join_forward_on_X_by_Y( left_values, right_values, left_by_values, diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index c3dacc2172aa7..1b5d26c7a63a5 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -2161,13 +2161,7 @@ def injection(obj): else: # choose appropriate function by type func = _asof_by_function(self.direction) - # TODO(cython3): - # Bug in beta1 preventing Cython from choosing - # right specialization when one fused memview is None - # Doesn't matter what type we choose - # (nothing happens anyways since it is None) - # GH 51640 - return func[f"{left_values.dtype}_t", object]( + return func( left_values, right_values, None, From 054525978afdc004d3d4e176484149ca09bb250c Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:50:31 -0400 Subject: [PATCH 2/2] Update ubuntu.yml --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2ea43b6b7e94f..f990c6edaeb2a 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -74,7 +74,7 @@ jobs: test_args: "-W error::DeprecationWarning -W error::FutureWarning" # TODO(cython3): Re-enable once next-beta(after beta 1) comes out # There are some warnings failing the build with -werror - #pandas_ci: "0" + pandas_ci: "0" exclude: - env_file: actions-38.yaml pyarrow_version: "8"