Skip to content

STY: Boolean values for bint variables #33005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions pandas/_libs/join.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def inner_join(const int64_t[:] left, const int64_t[:] right,

@cython.boundscheck(False)
def left_outer_join(const int64_t[:] left, const int64_t[:] right,
Py_ssize_t max_groups, sort=True):
Py_ssize_t max_groups, bint sort=True):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where I'm adding bint

cdef:
Py_ssize_t i, j, k, count = 0
ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
Expand Down Expand Up @@ -670,15 +670,15 @@ def asof_join_backward_on_X_by_Y(asof_t[:] left_values,
cdef:
Py_ssize_t left_pos, right_pos, left_size, right_size, found_right_pos
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
bint has_tolerance = False
asof_t tolerance_ = 0
asof_t diff = 0
HashTable hash_table
by_t by_value

# if we are using tolerance, set our objects
if tolerance is not None:
has_tolerance = 1
has_tolerance = True
tolerance_ = tolerance

left_size = len(left_values)
Expand Down Expand Up @@ -739,15 +739,15 @@ def asof_join_forward_on_X_by_Y(asof_t[:] left_values,
cdef:
Py_ssize_t left_pos, right_pos, left_size, right_size, found_right_pos
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
bint has_tolerance = False
asof_t tolerance_ = 0
asof_t diff = 0
HashTable hash_table
by_t by_value

# if we are using tolerance, set our objects
if tolerance is not None:
has_tolerance = 1
has_tolerance = True
tolerance_ = tolerance

left_size = len(left_values)
Expand Down Expand Up @@ -802,7 +802,7 @@ def asof_join_nearest_on_X_by_Y(asof_t[:] left_values,
asof_t[:] right_values,
by_t[:] left_by_values,
by_t[:] right_by_values,
bint allow_exact_matches=1,
bint allow_exact_matches=True,
tolerance=None):

cdef:
Expand Down Expand Up @@ -853,19 +853,19 @@ def asof_join_nearest_on_X_by_Y(asof_t[:] left_values,

def asof_join_backward(asof_t[:] left_values,
asof_t[:] right_values,
bint allow_exact_matches=1,
bint allow_exact_matches=True,
tolerance=None):

cdef:
Py_ssize_t left_pos, right_pos, left_size, right_size
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
bint has_tolerance = False
asof_t tolerance_ = 0
asof_t diff = 0

# if we are using tolerance, set our objects
if tolerance is not None:
has_tolerance = 1
has_tolerance = True
tolerance_ = tolerance

left_size = len(left_values)
Expand Down Expand Up @@ -906,19 +906,19 @@ def asof_join_backward(asof_t[:] left_values,

def asof_join_forward(asof_t[:] left_values,
asof_t[:] right_values,
bint allow_exact_matches=1,
bint allow_exact_matches=True,
tolerance=None):

cdef:
Py_ssize_t left_pos, right_pos, left_size, right_size
ndarray[int64_t] left_indexer, right_indexer
bint has_tolerance = 0
bint has_tolerance = False
asof_t tolerance_ = 0
asof_t diff = 0

# if we are using tolerance, set our objects
if tolerance is not None:
has_tolerance = 1
has_tolerance = True
tolerance_ = tolerance

left_size = len(left_values)
Expand Down Expand Up @@ -960,7 +960,7 @@ def asof_join_forward(asof_t[:] left_values,

def asof_join_nearest(asof_t[:] left_values,
asof_t[:] right_values,
bint allow_exact_matches=1,
bint allow_exact_matches=True,
tolerance=None):

cdef:
Expand Down