Skip to content

CLN: Simplify Block._astype #22369

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
TomAugspurger opened this issue Aug 15, 2018 · 3 comments
Closed

CLN: Simplify Block._astype #22369

TomAugspurger opened this issue Aug 15, 2018 · 3 comments
Labels
Clean Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code

Comments

@TomAugspurger
Copy link
Contributor

There's lots of nested logic there (plus 1 more level from #22343). Would be good to simplify this.

The components:

  1. argument validation (could maybe do this elsewhere, not a big deal)
  2. astyping to categorical is special cased. We'll want to remove that in favor of a generic astype system
  3. Determine target_dtype -> Block type
  4. _astype currently takes a values argument, which complicates things. Why is that? Why isn't it just self.values always?
@TomAugspurger TomAugspurger added Refactor Internal refactoring of code Internals Related to non-user accessible pandas implementation Difficulty Intermediate Clean labels Aug 15, 2018
@jorisvandenbossche
Copy link
Member

Personally, I think we rather need to rethink the full astype-mechanism/dispatching first (what we were discussing in the PR #22343)

@jbrockmendel
Copy link
Member

_astype currently takes a values argument, which complicates things. Why is that? Why isn't it just self.values always?

It is always None. It can't be removed until we get **kwargs out of NDFrame.astype 221b493#r34292758

@jbrockmendel
Copy link
Member

I think this has been simplified as much as it can be (until deprecations are enforced in 2.0). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code
Projects
None yet
Development

No branches or pull requests

3 participants