Skip to content

Avoid importing from pandas at _libs files #31977

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

Closed
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
6 changes: 2 additions & 4 deletions pandas/_libs/missing.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import cython
from cython import Py_ssize_t

import platform
import numbers

import numpy as np
Expand All @@ -16,16 +17,13 @@ from pandas._libs.tslibs.nattype cimport (
checknull_with_nat, c_NaT as NaT, is_null_datetimelike)
from pandas._libs.ops_dispatch import maybe_dispatch_ufunc_to_dunder_op

from pandas.compat import is_platform_32bit


cdef:
float64_t INF = <float64_t>np.inf
float64_t NEGINF = -INF

int64_t NPY_NAT = util.get_nat()

bint is_32bit = is_platform_32bit()
Copy link
Member

Choose a reason for hiding this comment

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

can you do bint is_32bit = platform.architecture()[0] == "32-bit" and avoid re-computing at runtime?

bint is_32bit = platform.architecture()[0] == "32-bit"


cpdef bint checknull(object val):
Expand Down