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

Function test_query_with_meta

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

Source from the content-addressed store, hash-verified

430
431
432def test_query_with_meta(db):
433 from sqlalchemy import sql
434
435 data = {
436 "name": pd.Series([], name="name", dtype="str"),
437 "age": pd.Series([], name="age", dtype="int"),
438 }
439 index = pd.Index([], name="number", dtype="int")
440 meta = pd.DataFrame(data, index=index)
441
442 s1 = sql.select(
443 sql.column("number"), sql.column("name"), sql.column("age")
444 ).select_from(sql.table("test"))
445 out = read_sql_query(s1, db, npartitions=2, index_col="number", meta=meta)
446 # Don't check dtype for windows https://github.com/dask/dask/issues/8620
447 assert_eq(out, df[["name", "age"]], check_dtype=sys.platform != "win32")
448
449
450def test_no_character_index_without_divisions(db):

Callers

nothing calls this directly

Calls 2

read_sql_queryFunction · 0.90
assert_eqFunction · 0.90

Tested by

no test coverage detected