Skip to content

Commit 3a2ec64

Browse files
authored
COMPAT: Remove unnecessary memoryview workaround (#52237)
* COMPAT: Update code for Cython 3.0b2 * Update ubuntu.yml
1 parent 894bcd9 commit 3a2ec64

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

pandas/_libs/join.pyx

+2-12
Original file line numberDiff line numberDiff line change
@@ -850,17 +850,7 @@ def asof_join_nearest_on_X_by_Y(ndarray[numeric_t] left_values,
850850
numeric_t bdiff, fdiff
851851

852852
# search both forward and backward
853-
# TODO(cython3):
854-
# Bug in beta1 preventing Cython from choosing
855-
# right specialization when one fused memview is None
856-
# Doesn't matter what type we choose
857-
# (nothing happens anyways since it is None)
858-
# GH 51640
859-
if left_by_values is not None and left_by_values.dtype != object:
860-
by_dtype = f"{left_by_values.dtype}_t"
861-
else:
862-
by_dtype = object
863-
bli, bri = asof_join_backward_on_X_by_Y[f"{left_values.dtype}_t", by_dtype](
853+
bli, bri = asof_join_backward_on_X_by_Y(
864854
left_values,
865855
right_values,
866856
left_by_values,
@@ -869,7 +859,7 @@ def asof_join_nearest_on_X_by_Y(ndarray[numeric_t] left_values,
869859
tolerance,
870860
use_hashtable
871861
)
872-
fli, fri = asof_join_forward_on_X_by_Y[f"{left_values.dtype}_t", by_dtype](
862+
fli, fri = asof_join_forward_on_X_by_Y(
873863
left_values,
874864
right_values,
875865
left_by_values,

pandas/core/reshape/merge.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -2207,13 +2207,7 @@ def injection(obj: ArrayLike):
22072207
else:
22082208
# choose appropriate function by type
22092209
func = _asof_by_function(self.direction)
2210-
# TODO(cython3):
2211-
# Bug in beta1 preventing Cython from choosing
2212-
# right specialization when one fused memview is None
2213-
# Doesn't matter what type we choose
2214-
# (nothing happens anyways since it is None)
2215-
# GH 51640
2216-
return func[f"{left_values.dtype}_t", object](
2210+
return func(
22172211
left_values,
22182212
right_values,
22192213
None,

0 commit comments

Comments
 (0)