Skip to content

CLN: avoid runtime imports #27461

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 14 commits into from
Jul 22, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
dont do imports at runtime
  • Loading branch information
jbrockmendel committed Jul 18, 2019
commit f60506bd032964bf95247bfe41471ab1597ca558
11 changes: 8 additions & 3 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@
from pandas.core import ops
from pandas.core.accessor import PandasDelegate, delegate_names
import pandas.core.algorithms as algorithms
from pandas.core.algorithms import factorize, take, take_1d, unique1d
from pandas.core.algorithms import (
factorize,
take,
take_1d,
unique1d,
_get_data_algo,
_hashtables,
)
from pandas.core.base import NoNewAttributesMixin, PandasObject, _shared_docs
import pandas.core.common as com
from pandas.core.missing import interpolate_2d
Expand Down Expand Up @@ -2666,8 +2673,6 @@ def _get_codes_for_values(values, categories):
"""
utility routine to turn values into codes given the specified categories
"""
from pandas.core.algorithms import _get_data_algo, _hashtables

dtype_equal = is_dtype_equal(values.dtype, categories.dtype)

if dtype_equal:
Expand Down