f625f9e060e258c903e44f2d28a6689a123842af,lore/io/connection.py,Connection,insert,#Connection#Any#Any#Any#,162
Before Change
self._connection.connection.cursor().copy_from(rows, table, null="\\N", sep="|", columns=dataframe.columns)
self._connection.connection.commit()
del rows
gc.collect()
else:
dataframe.to_sql(
table,
self._connection,
After Change
self._connection.connection.commit()
del rows
elif self._engine.dialect.name == "snowflake":
// snowflake requires s3 upload to bulk insert
try:
tmp = tempfile.NamedTemporaryFile(delete=False, suffix=".csv.gz")
tmp.close()
batch.to_csv(tmp.name, index=False, header=False, sep="|", na_rep="\\N", quoting=csv.QUOTE_NONE, compression="gzip")
self._connection.connection.cursor().execute("PUT file://%(path)s @~/staged;" % {"path": tmp.name})
self._connection.connection.cursor().execute(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: instacart/lore
Commit Name: f625f9e060e258c903e44f2d28a6689a123842af
Time: 2018-10-10
Author: montanalow@users.noreply.github.com
File Name: lore/io/connection.py
Class Name: Connection
Method Name: insert
Project Name: OpenNMT/OpenNMT-py
Commit Name: 23dffb96ac95827a3af89f6ff027d254284ba93c
Time: 2019-02-08
Author: guillaumekln@users.noreply.github.com
File Name: onmt/inputters/inputter.py
Class Name: DatasetLazyIter
Method Name: __iter__
Project Name: mne-tools/mne-python
Commit Name: 06298716dc48db52f69496e4248927f90925ee65
Time: 2020-10-22
Author: larson.eric.d@gmail.com
File Name: doc/conf.py
Class Name: Resetter
Method Name: __call__