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

Function test_read_sql

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

Source from the content-addressed store, hash-verified

454
455
456def test_read_sql(db):
457 from sqlalchemy import sql
458
459 s = sql.select(sql.column("number"), sql.column("name")).select_from(
460 sql.table("test")
461 )
462 out = read_sql(s, db, npartitions=2, index_col="number")
463 assert_eq(out, df[["name"]])
464
465 data = read_sql_table("test", db, npartitions=2, index_col="number").compute()
466 assert (data.name == df.name).all()
467 assert data.index.name == "number"
468 assert_eq(data, df)
469
470
471@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