Problem description
pandas.to_sql()
takes a method
argument that allows one to perform the insert into the database table using a method other than the normal series of INSERT
statements.
The callable that can be passed using this argument must take a data_iter
argument, an iterable containing the data. Alas, I can easily imagine ways of writing to the database in which it would be a good idea not to force conversion from pandas DataFrame to iterable. Analogously to the example in the docs of using Postgres' COPY
function, it might make sense, for example, when loading data into Snowflake to dump the pandas DataFrame to Parquet in its entirety, transfer it to Snowflake and then to COPY it into the table. Stable data types, stable encodings -- all the things one would otherwise have to worry about.
Would you consider changing the call signature of the callable to allow this?
Comment From: mroeschke
Thanks for the suggestion, but based on the lack of discussion from the core devs and community looks like there's not much interest so closing.