mtsql 1.12.8__py3-none-any.whl → 1.12.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mt/sql/base.py +8 -6
- mt/sql/version.py +1 -1
- {mtsql-1.12.8.dist-info → mtsql-1.12.10.dist-info}/METADATA +2 -2
- {mtsql-1.12.8.dist-info → mtsql-1.12.10.dist-info}/RECORD +7 -7
- {mtsql-1.12.8.dist-info → mtsql-1.12.10.dist-info}/WHEEL +0 -0
- {mtsql-1.12.8.dist-info → mtsql-1.12.10.dist-info}/licenses/LICENSE +0 -0
- {mtsql-1.12.8.dist-info → mtsql-1.12.10.dist-info}/top_level.txt +0 -0
mt/sql/base.py
CHANGED
|
@@ -456,7 +456,7 @@ def temp_table_drop(
|
|
|
456
456
|
|
|
457
457
|
|
|
458
458
|
@ctx.contextmanager
|
|
459
|
-
def to_temp_table(df: pd.DataFrame, engine: sa.engine.Engine):
|
|
459
|
+
def to_temp_table(df: pd.DataFrame, engine: sa.engine.Engine, **kwds):
|
|
460
460
|
"""
|
|
461
461
|
A context manager that uploads a dataframe to a temp table and cleans up the table when done.
|
|
462
462
|
|
|
@@ -469,12 +469,14 @@ def to_temp_table(df: pd.DataFrame, engine: sa.engine.Engine):
|
|
|
469
469
|
dataframe to be uploaded to the database as a temporary table
|
|
470
470
|
engine : sqlalchemy.engine.Engine
|
|
471
471
|
engine connrecting to the database
|
|
472
|
+
**kwds : dict
|
|
473
|
+
other keyword arguments passed as-is to :func:`pandas.DataFrame.to_sql`
|
|
472
474
|
"""
|
|
473
475
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
+
tid = temp_table_find_new_id(engine)
|
|
477
|
+
name = temp_table_name(tid)
|
|
476
478
|
try:
|
|
477
|
-
df.to_sql(
|
|
478
|
-
yield
|
|
479
|
+
df.to_sql(name, engine, **kwds)
|
|
480
|
+
yield name
|
|
479
481
|
finally:
|
|
480
|
-
temp_table_drop(engine,
|
|
482
|
+
temp_table_drop(engine, tid)
|
mt/sql/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mtsql
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.10
|
|
4
4
|
Summary: Extra Python modules to deal with the interaction between pandas dataframes and remote SQL servers, for Minh-Tri Pham
|
|
5
5
|
Home-page: https://github.com/inteplus/mtsql
|
|
6
6
|
Author: ['Minh-Tri Pham']
|
|
@@ -12,7 +12,7 @@ Requires-Dist: tzlocal
|
|
|
12
12
|
Requires-Dist: tqdm
|
|
13
13
|
Requires-Dist: psycopg[binary]
|
|
14
14
|
Requires-Dist: redshift_connector>=2.1.5
|
|
15
|
-
Requires-Dist: mtbase>=4.32.
|
|
15
|
+
Requires-Dist: mtbase>=4.32.21
|
|
16
16
|
Requires-Dist: mtpandas>=1.17.10
|
|
17
17
|
Dynamic: author
|
|
18
18
|
Dynamic: home-page
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
-
mt/sql/base.py,sha256=
|
|
2
|
+
mt/sql/base.py,sha256=k7yav8JVP-Z0hqlsSuKmzm_HKYtq7dFtpaLhyhgyc7k,13088
|
|
3
3
|
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
4
|
mt/sql/psql.py,sha256=dNPOvJBxZ8S88uOmIKnfjo1ssRiMLDLwVeJcVcdcNco,66580
|
|
5
5
|
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
6
|
-
mt/sql/version.py,sha256=
|
|
6
|
+
mt/sql/version.py,sha256=BgX8JcjmUH-qTZ5xTJECQnYYXE0gZHb8rHFgiprkJMs,208
|
|
7
7
|
mt/sql/redshift/__init__.py,sha256=S-eRxJWcrvncF7LZXuulCdPV-UERu9eiw6uyDb5aGsM,443
|
|
8
8
|
mt/sql/redshift/commands.py,sha256=xhGUBf3bL66EYdZI5HCUtOx-XqPCnXT_P-LnhPgtzrY,40193
|
|
9
9
|
mt/sql/redshift/ddl.py,sha256=eUcZj9oIajiE1wKKBAP-V64gYJ7cVnSAt8dLFfluOJA,9777
|
|
10
10
|
mt/sql/redshift/dialect.py,sha256=oomLiQib0iMhotRY3GjDrQI3iWGXgcIQyK5WTbmj8kc,53431
|
|
11
11
|
mt/sql/redshift/main.py,sha256=6dwnwNJ1F0_V9o2oqrSOkyN_pAMrgE01CCoqAjoyOME,17116
|
|
12
12
|
mt/sql/redshift/redshift-ca-bundle.crt,sha256=532qYkOpQOstFE0mdXE1GVtL3v00XDKgZNTr6gK5-KE,8621
|
|
13
|
-
mtsql-1.12.
|
|
14
|
-
mtsql-1.12.
|
|
15
|
-
mtsql-1.12.
|
|
16
|
-
mtsql-1.12.
|
|
17
|
-
mtsql-1.12.
|
|
13
|
+
mtsql-1.12.10.dist-info/licenses/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
14
|
+
mtsql-1.12.10.dist-info/METADATA,sha256=jnU1oJtaT3iRrapN8HdlceCoqpaE6iIerQqSwndOoVI,740
|
|
15
|
+
mtsql-1.12.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
mtsql-1.12.10.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
17
|
+
mtsql-1.12.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|