Skip to content

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

Merged
merged 7 commits into from
Oct 4, 2020
Merged

Conversation

ivanovmg
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Refactor/cleanup _get_empty_dtype_and_na in pandas/core/internals/concat.py
Extract functions, add typing.

Copy link
Member

@simonjayhawkins simonjayhawkins left a 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.

@@ -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
Copy link
Member

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.

Copy link
Member Author

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.

@simonjayhawkins simonjayhawkins added this to the 1.2 milestone Sep 29, 2020
@simonjayhawkins simonjayhawkins added the Refactor Internal refactoring of code label Sep 29, 2020
@mroeschke mroeschke merged commit faf6d3f into pandas-dev:master Oct 4, 2020
@mroeschke
Copy link
Member

Thanks @ivanovmg

@ivanovmg ivanovmg deleted the refactor/concat branch October 4, 2020 13:22
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Oct 13, 2020
* 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
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants