MCPcopy Create free account
hub / github.com/dask/dask / test_parse_dates_multi_column

Function test_parse_dates_multi_column

dask/dataframe/io/tests/test_csv.py:1179–1211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1177
1178
1179def test_parse_dates_multi_column():
1180 pdmc_text = normalize_text("""
1181 ID,date,time
1182 10,2003-11-04,180036
1183 11,2003-11-05,125640
1184 12,2003-11-01,2519
1185 13,2003-10-22,142559
1186 14,2003-10-24,163113
1187 15,2003-10-20,170133
1188 16,2003-11-11,160448
1189 17,2003-11-03,171759
1190 18,2003-11-07,190928
1191 19,2003-10-21,84623
1192 20,2003-10-25,192207
1193 21,2003-11-13,180156
1194 22,2003-11-15,131037
1195 """)
1196
1197 ctx = contextlib.nullcontext()
1198 if PANDAS_GE_300:
1199 # Removed in pandas=3.0
1200 ctx = pytest.raises(TypeError, match="list indices")
1201 elif PANDAS_GE_220:
1202 # Deprecated in pandas=2.2.0
1203 ctx = pytest.warns(FutureWarning, match="nested")
1204
1205 with ctx:
1206 with filetext(pdmc_text) as fn:
1207 ddf = dd.read_csv(fn, parse_dates=[["date", "time"]])
1208 df = pd.read_csv(fn, parse_dates=[["date", "time"]])
1209
1210 assert (df.columns == ddf.columns).all()
1211 assert len(df) == len(ddf)
1212
1213
1214def test_read_csv_sep():

Callers

nothing calls this directly

Calls 4

filetextFunction · 0.90
normalize_textFunction · 0.85
read_csvMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected