Skip to content

Commit b6fdc13

Browse files
authored
STY: bint boolean values rather than integer values (#33005)
1 parent 08ae41b commit b6fdc13

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pandas/_libs/join.pyx

+13-13
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def inner_join(const int64_t[:] left, const int64_t[:] right,
7878

7979
@cython.boundscheck(False)
8080
def left_outer_join(const int64_t[:] left, const int64_t[:] right,
81-
Py_ssize_t max_groups, sort=True):
81+
Py_ssize_t max_groups, bint sort=True):
8282
cdef:
8383
Py_ssize_t i, j, k, count = 0
8484
ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
@@ -670,15 +670,15 @@ def asof_join_backward_on_X_by_Y(asof_t[:] left_values,
670670
cdef:
671671
Py_ssize_t left_pos, right_pos, left_size, right_size, found_right_pos
672672
ndarray[int64_t] left_indexer, right_indexer
673-
bint has_tolerance = 0
673+
bint has_tolerance = False
674674
asof_t tolerance_ = 0
675675
asof_t diff = 0
676676
HashTable hash_table
677677
by_t by_value
678678

679679
# if we are using tolerance, set our objects
680680
if tolerance is not None:
681-
has_tolerance = 1
681+
has_tolerance = True
682682
tolerance_ = tolerance
683683

684684
left_size = len(left_values)
@@ -739,15 +739,15 @@ def asof_join_forward_on_X_by_Y(asof_t[:] left_values,
739739
cdef:
740740
Py_ssize_t left_pos, right_pos, left_size, right_size, found_right_pos
741741
ndarray[int64_t] left_indexer, right_indexer
742-
bint has_tolerance = 0
742+
bint has_tolerance = False
743743
asof_t tolerance_ = 0
744744
asof_t diff = 0
745745
HashTable hash_table
746746
by_t by_value
747747

748748
# if we are using tolerance, set our objects
749749
if tolerance is not None:
750-
has_tolerance = 1
750+
has_tolerance = True
751751
tolerance_ = tolerance
752752

753753
left_size = len(left_values)
@@ -802,7 +802,7 @@ def asof_join_nearest_on_X_by_Y(asof_t[:] left_values,
802802
asof_t[:] right_values,
803803
by_t[:] left_by_values,
804804
by_t[:] right_by_values,
805-
bint allow_exact_matches=1,
805+
bint allow_exact_matches=True,
806806
tolerance=None):
807807

808808
cdef:
@@ -853,19 +853,19 @@ def asof_join_nearest_on_X_by_Y(asof_t[:] left_values,
853853

854854
def asof_join_backward(asof_t[:] left_values,
855855
asof_t[:] right_values,
856-
bint allow_exact_matches=1,
856+
bint allow_exact_matches=True,
857857
tolerance=None):
858858

859859
cdef:
860860
Py_ssize_t left_pos, right_pos, left_size, right_size
861861
ndarray[int64_t] left_indexer, right_indexer
862-
bint has_tolerance = 0
862+
bint has_tolerance = False
863863
asof_t tolerance_ = 0
864864
asof_t diff = 0
865865

866866
# if we are using tolerance, set our objects
867867
if tolerance is not None:
868-
has_tolerance = 1
868+
has_tolerance = True
869869
tolerance_ = tolerance
870870

871871
left_size = len(left_values)
@@ -906,19 +906,19 @@ def asof_join_backward(asof_t[:] left_values,
906906

907907
def asof_join_forward(asof_t[:] left_values,
908908
asof_t[:] right_values,
909-
bint allow_exact_matches=1,
909+
bint allow_exact_matches=True,
910910
tolerance=None):
911911

912912
cdef:
913913
Py_ssize_t left_pos, right_pos, left_size, right_size
914914
ndarray[int64_t] left_indexer, right_indexer
915-
bint has_tolerance = 0
915+
bint has_tolerance = False
916916
asof_t tolerance_ = 0
917917
asof_t diff = 0
918918

919919
# if we are using tolerance, set our objects
920920
if tolerance is not None:
921-
has_tolerance = 1
921+
has_tolerance = True
922922
tolerance_ = tolerance
923923

924924
left_size = len(left_values)
@@ -960,7 +960,7 @@ def asof_join_forward(asof_t[:] left_values,
960960

961961
def asof_join_nearest(asof_t[:] left_values,
962962
asof_t[:] right_values,
963-
bint allow_exact_matches=1,
963+
bint allow_exact_matches=True,
964964
tolerance=None):
965965

966966
cdef:

0 commit comments

Comments
 (0)