Skip to content

[DEPR] Assorted footguns in dtype checks #22137

Closed
@jbrockmendel

Description

@jbrockmendel

Finding some things that don't behave in The Obvious Way:

  • dtypes.common.is_period
    Never used outside of tests, checks for PeriodDtype-like arrays, not Period scalar.
  • dtypes.common.is_datetimelike
    Checks for datetime64_dtype, datetime64tz_dtype, PeriodIndex, or timedelta64_dtype, the last of which is not obvious (and in fact caused some bugs that will be fixed by [Bug] Fix various DatetimeIndex comparison bugs #22074)
  • dtypes.common.is_int_or_datetime_dtype only used in two places, better to write out the conditions explicitly.
  • dtypes.common.is_floating_dtype deprecated in 0.20.0, is it too early to remove?
  • dtypes.common.is_datetimetz appears to be a duplicate of is_datetime64tz_dtype
  • lib.is_integer
    Returns True for timedelta64 objects; inconsistent with is_integer_dtype which excludes timedelta64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions