()
| 346 | |
| 347 | |
| 348 | def test_datetimes(): |
| 349 | import datetime |
| 350 | |
| 351 | now = datetime.datetime.now() |
| 352 | d = datetime.timedelta(seconds=1) |
| 353 | df = pd.DataFrame( |
| 354 | {"a": list("ghjkl"), "b": [now + i * d for i in range(2, -3, -1)]} |
| 355 | ) |
| 356 | with tmpfile() as f: |
| 357 | uri = f"sqlite:///{f}" |
| 358 | df.to_sql("test", uri, index=False, if_exists="replace") |
| 359 | data = read_sql_table("test", uri, npartitions=2, index_col="b") |
| 360 | assert data.index.dtype.kind == "M" |
| 361 | assert data.divisions[0] == df.b.min() |
| 362 | df2 = df.set_index("b") |
| 363 | assert_eq( |
| 364 | data.map_partitions(lambda x: x.sort_index()), |
| 365 | df2.sort_index(), |
| 366 | check_dtype=False, |
| 367 | ) |
| 368 | |
| 369 | |
| 370 | def test_extra_connection_engine_keywords(caplog, db): |
nothing calls this directly
no test coverage detected
searching dependent graphs…