@@ -205,11 +205,13 @@ def graph():
205205 csp .run (graph , starttime = start_time )
206206 df = pandas .read_parquet (filename )
207207 expected_columns = {}
208- # pandas 3.0+: need to explicitly force ns unit and UTC tz, no longer the default
208+ # Build the expected index explicitly rather than via pandas.date_range(...),
209+ # which segfaults under pandas 3.0.4 + numpy<2.5 (tslibs offset ABI mismatch).
210+ # This yields the same datetime64[ns, UTC] values.
209211 if timestamp_column_name :
210- expected_columns [timestamp_column_name ] = pandas .date_range (
211- start = start_time + timedelta (seconds = 1 ), periods = 10 , unit = "ns" , freq = "1s" , tz = "UTC"
212- )
212+ expected_columns [timestamp_column_name ] = pandas .DatetimeIndex (
213+ [ start_time + timedelta (seconds = i ) for i in range ( 1 , 11 )]
214+ ). as_unit ( "ns" )
213215 expected_columns .update (
214216 {
215217 "x" : list (range (1 , 11 )),
@@ -242,10 +244,12 @@ def graph():
242244
243245 expected_df = pandas .DataFrame .from_dict (
244246 {
245- # pandas 3.0+: need to explicitly force ns unit and UTC tz, no longer the default
246- "timestamp" : pandas .date_range (
247- start = start_time + timedelta (seconds = 1 ), periods = 10 , unit = "ns" , freq = "1s" , tz = "UTC"
248- ),
247+ # Build the expected index explicitly rather than via pandas.date_range(...),
248+ # which segfaults under pandas 3.0.4 + numpy<2.5 (tslibs offset ABI mismatch).
249+ # This yields the same datetime64[ns, UTC] values.
250+ "timestamp" : pandas .DatetimeIndex (
251+ [start_time + timedelta (seconds = i ) for i in range (1 , 11 )]
252+ ).as_unit ("ns" ),
249253 "x" : list (range (1 , 11 )),
250254 "y" : list (map (float , range (0 , 100 , 10 ))),
251255 }
0 commit comments