Skip to content

feat: simplified type which maps to pandas timedelta / pyarrow duration semantics #8697

Open
@tswast

Description

@tswast

Is your feature request related to a problem?

In BigQuery DataFrames, we'd like to provide an API to allow users to get something like a pandas timedelta / pyarrow duration for some datetime / timestamp operations. Currently in Ibis (and BigQuery for that matter) we have two options, neither of which is fully ideal:

  1. Use BigQuery (and Ibis) "interval" data type. This is a superset of the timedelta/duration behavior in that it also allows for calendar-aware days & months, similar to the pyarrow month_day_nano_interval type. This type is a bit awkard to work with at the moment and doesn't really map to anything useful in pandas (yet?)
  2. Use integers and keep track of the units on our own.

Describe the solution you'd like

I'd love for an ibis duration type similar to the pyarrow type. For backends that don't have an equivalent, pandas could keep track of the units locally.

What version of ibis are you running?

8.0.0

What backend(s) are you using, if any?

BigQuery (maybe polars in future?)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    datatypesIssues relating to ibis's datatypes (under `ibis.expr.datatypes`)featureFeatures or general enhancements

    Type

    No type

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions