Skip to content

support nanosecond precision values in TimeDtype #19

Closed as not planned
Closed as not planned
@tswast

Description

@tswast

datetime.time only supports microsecond precision.

Similarly, the BigQuery TIME data type only returns microsecond precision.

The pandas convention is to use nanosecond precision for timestamps via the pandas.Timestamp class. It may make sense for this extension dtype to also support this.

Subtasks:

  • Preserve nanoseconds when we are given them in the data (e.g. from numpy array or pyarrow array).
  • Add unit as an optional argument in the dtype constructor, similar to https://github.com/pandas-dev/pandas/blob/1c986d6213904fd7d9acc5622dc91d029d3f1218/pandas/core/dtypes/dtypes.py#L777 -- Note: maybe unnecessary since we always store as nanoseconds, but could be useful as a box/unbox hint (see below)
  • Return / accept something other than datetime.time that supports nanoseconds instead of only microsecond precision. This is similar to datetime.datetime versus pandas.Timestamp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-db-dtypes-pandas API.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions