Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions csp/tests/adapters/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ def graph():
csp.run(graph, starttime=start_time)
df = pandas.read_parquet(filename)
expected_columns = {}
# pandas 3.0+: need to explicitly force ns unit and UTC tz, no longer the default
# Build the expected index explicitly rather than via pandas.date_range(...),
# which segfaults under pandas 3.0.4 + numpy<2.5 (tslibs offset ABI mismatch).
# This yields the same datetime64[ns, UTC] values.
if timestamp_column_name:
expected_columns[timestamp_column_name] = pandas.date_range(
start=start_time + timedelta(seconds=1), periods=10, unit="ns", freq="1s", tz="UTC"
)
expected_columns[timestamp_column_name] = pandas.DatetimeIndex(
[start_time + timedelta(seconds=i) for i in range(1, 11)]
).as_unit("ns")
expected_columns.update(
{
"x": list(range(1, 11)),
Expand Down Expand Up @@ -242,10 +244,12 @@ def graph():

expected_df = pandas.DataFrame.from_dict(
{
# pandas 3.0+: need to explicitly force ns unit and UTC tz, no longer the default
"timestamp": pandas.date_range(
start=start_time + timedelta(seconds=1), periods=10, unit="ns", freq="1s", tz="UTC"
),
# Build the expected index explicitly rather than via pandas.date_range(...),
# which segfaults under pandas 3.0.4 + numpy<2.5 (tslibs offset ABI mismatch).
# This yields the same datetime64[ns, UTC] values.
"timestamp": pandas.DatetimeIndex(
[start_time + timedelta(seconds=i) for i in range(1, 11)]
).as_unit("ns"),
"x": list(range(1, 11)),
"y": list(map(float, range(0, 100, 10))),
}
Expand Down
Loading