Skip to content

REF: de-duplicate Index._find_common_type_compat and dtypes.cast.find_result_type #45149

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
jbrockmendel opened this issue Dec 31, 2021 · 6 comments
Labels
Refactor Internal refactoring of code

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Dec 31, 2021

In particular both include logic for working around Categoricals. Not sure how much is shareable, but worth a shot.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 31, 2021
@yuri-stepanov
Copy link

I will try to look at that. From the first glance not sure I can make it more readable, but I will give it shot. If anything will pan out I will create a PR. Otherwise I will comment here =)

@yuri-stepanov
Copy link

take

@jbrockmendel jbrockmendel added Refactor Internal refactoring of code and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 6, 2022
@yuri-stepanov
Copy link

yuri-stepanov commented Jan 12, 2022

Just wanted to update that I am still looking at that refactoring and if I am not blocking anyone I would be glad to continue. This took me on a fascinating adventure around pandas \ numpy type system =).

At the moment I was looking through the code and relevant issues discussion like #26778 and #37258. It was interesting to learn about all of this corner cases.
I think that at the moment the best that can be done without breaking the compatibility is refactoring of the logic for categorical types, as was mentioned by @jbrockmendel, but I really need to think where is the best place to put it.

@jbrockmendel
Copy link
Member Author

but I really need to think where is the best place to put it

Newly-implemented dtypes.cast.find_result_type

@yuri-stepanov
Copy link

@jbrockmendel I think you beat me to it. Still it was interesting =)

@yuri-stepanov yuri-stepanov removed their assignment Jan 17, 2022
@jbrockmendel jbrockmendel changed the title REF: de-duplicate Index._find_common_type_compat and concat.cast_to_common_type REF: de-duplicate Index._find_common_type_compat and dtypes.cast.find_result_type Feb 24, 2023
@jbrockmendel
Copy link
Member Author

Closing as pushed as far is it can go without API changes.

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

No branches or pull requests

2 participants