Skip to content

test: make constructor_with_tz and constructor_with_ns utilities #2742

@MarcoGorelli

Description

@MarcoGorelli

Writing tests which include time zones and nanoseconds is repeatedly quite painful, e.g. see #2733 and similar tests 😩

Perhaps this could be alleviated if we made constructor_with_timezone and constructor_with_ns utilities, which could be called like

df_native = constructor_with_tz({'a': [1577833200000000]}, time_zone='Europe/Amsterdam')

then it would create a dataframe that looks like this

shape: (1, 1)
┌────────────────────────────────┐
│ a                              │
│ ---                            │
│ datetime[ns, Europe/Amsterdam] │
╞════════════════════════════════╡
│ 2020-01-01 00:00:00 CET        │
└────────────────────────────────┘

all the skips, like for windows or for pyarrow versions without local_timestamp, could be done at the constructor / conftest level

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions