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

Function test_read_sql

dask/dataframe/io/tests/test_sql.py:462–474  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

460
461
462def test_read_sql(db):
463 from sqlalchemy import sql
464
465 s = sql.select(sql.column("number"), sql.column("name")).select_from(
466 sql.table("test")
467 )
468 out = read_sql(s, db, npartitions=2, index_col="number")
469 assert_eq(out, df[["name"]])
470
471 data = read_sql_table("test", db, npartitions=2, index_col="number").compute()
472 assert (data.name == df.name).all()
473 assert data.index.name == "number"
474 assert_eq(data, df)
475
476
477@contextmanager

Callers

nothing calls this directly

Calls 5

read_sqlFunction · 0.90
assert_eqFunction · 0.90
read_sql_tableFunction · 0.90
computeMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected