Skip to content

CLN: Simplify Block._astype #22369

Closed
Closed
@TomAugspurger

Description

@TomAugspurger

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanInternalsRelated to non-user accessible pandas implementationRefactorInternal refactoring of code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions