-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: private funcs in concat.py #36726
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ivanovmg generally lgtm pending green and code checks passing.
pandas/core/internals/concat.py
Outdated
@@ -25,6 +25,7 @@ | |||
|
|||
import pandas.core.algorithms as algos | |||
from pandas.core.arrays import DatetimeArray, ExtensionArray | |||
from pandas.core.arrays.sparse.dtype import SparseDtype |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure if we have a policy, but in general if the type is imported just for type checking, we normally put in an if TYPE_CHECKING:
block. If this is not creating import errors then maybe OK. see what others think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simonjayhawkins, I updated imports as you suggested, so that SparseDtype is used only for type checking.
Thanks @ivanovmg |
* REF: extract func _select_upcast_cls_from_dtype * REF: extract function _get_upcast_classes * CLN: rename g -> common_dtype * TYP: type extracted functions * DOC: add docstrings to extracted methods * TYP: cast instead of ignoring mypy error * CLN: import SparseDtype only for type checking
* REF: extract func _select_upcast_cls_from_dtype * REF: extract function _get_upcast_classes * CLN: rename g -> common_dtype * TYP: type extracted functions * DOC: add docstrings to extracted methods * TYP: cast instead of ignoring mypy error * CLN: import SparseDtype only for type checking
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Refactor/cleanup
_get_empty_dtype_and_na
inpandas/core/internals/concat.py
Extract functions, add typing.