MCPcopy
hub / github.com/pandas-dev/pandas / create_and_load_iris

Function create_and_load_iris

pandas/tests/io/test_sql.py:186–199  ·  view source on GitHub ↗
(conn, iris_file: Path)

Source from the content-addressed store, hash-verified

184
185
186def create_and_load_iris(conn, iris_file: Path):
187 from sqlalchemy import insert
188
189 iris = iris_table_metadata()
190
191 with iris_file.open(newline=None, encoding="utf-8") as csvfile:
192 reader = csv.reader(csvfile)
193 header = next(reader)
194 params = [dict(zip(header, row)) for row in reader]
195 stmt = insert(iris).values(params)
196 with conn.begin() as con:
197 iris.drop(con, checkfirst=True)
198 iris.create(bind=con)
199 con.execute(stmt)
200
201
202def create_and_load_iris_view(conn):

Callers 4

sqlite_str_irisFunction · 0.85
sqlite_engine_irisFunction · 0.85

Calls 6

iris_table_metadataFunction · 0.85
openMethod · 0.45
valuesMethod · 0.45
dropMethod · 0.45
createMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected