mtsql 1.11.7__py3-none-any.whl → 1.11.9__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 -5
- mt/sql/version.py +1 -1
- {mtsql-1.11.7.dist-info → mtsql-1.11.9.dist-info}/METADATA +1 -1
- mtsql-1.11.9.dist-info/RECORD +12 -0
- {mtsql-1.11.7.dist-info → mtsql-1.11.9.dist-info}/WHEEL +1 -1
- mtsql-1.11.7.dist-info/RECORD +0 -12
- {mtsql-1.11.7.dist-info → mtsql-1.11.9.dist-info}/LICENSE +0 -0
- {mtsql-1.11.7.dist-info → mtsql-1.11.9.dist-info}/top_level.txt +0 -0
mt/sql/base.py
CHANGED
|
@@ -75,15 +75,14 @@ def run_func(
|
|
|
75
75
|
se.OperationalError,
|
|
76
76
|
ps.OperationalError,
|
|
77
77
|
se.InterfaceError,
|
|
78
|
+
se.PendingRollbackError,
|
|
78
79
|
):
|
|
79
80
|
if logger:
|
|
80
81
|
msg = f"Ignored an exception raised by failed attempt {x+1}/{nb_trials} to execute `{func.__module__}.{func.__name__}()`"
|
|
81
82
|
with logger.scoped_warn(msg):
|
|
82
83
|
logger.warn_last_exception()
|
|
83
84
|
raise RuntimeError(
|
|
84
|
-
"Attempted {} times to execute `{}.{}()` but failed."
|
|
85
|
-
nb_trials, func.__module__, func.__name__
|
|
86
|
-
)
|
|
85
|
+
f"Attempted {nb_trials} times to execute `{func.__module__}.{}(func.__name__)` but failed."
|
|
87
86
|
)
|
|
88
87
|
|
|
89
88
|
|
|
@@ -365,7 +364,9 @@ def table_exists(
|
|
|
365
364
|
return sa.inspect(engine).has_table(table_name, schema=schema)
|
|
366
365
|
|
|
367
366
|
|
|
368
|
-
def create_temp_id_table(
|
|
367
|
+
def create_temp_id_table(
|
|
368
|
+
l_ids: list, conn: sa.engine.Connection, int_type="int"
|
|
369
|
+
) -> str:
|
|
369
370
|
"""Creates a temporary table to containing a list of ids.
|
|
370
371
|
|
|
371
372
|
Parameters
|
|
@@ -374,6 +375,8 @@ def create_temp_id_table(l_ids: list, conn: sa.engine.Connection) -> str:
|
|
|
374
375
|
list of ids to be inserted into the table
|
|
375
376
|
conn : sqlalchemy.engine.Connection
|
|
376
377
|
a connection that has been opened
|
|
378
|
+
int_type : str
|
|
379
|
+
an SQL string representing the int type
|
|
377
380
|
|
|
378
381
|
Returns
|
|
379
382
|
-------
|
|
@@ -383,7 +386,7 @@ def create_temp_id_table(l_ids: list, conn: sa.engine.Connection) -> str:
|
|
|
383
386
|
|
|
384
387
|
table_name = f"tab_{uuid.uuid4().hex}"
|
|
385
388
|
|
|
386
|
-
query_str = f"CREATE TEMP TABLE {table_name}(id
|
|
389
|
+
query_str = f"CREATE TEMP TABLE {table_name}(id {int_type});"
|
|
387
390
|
conn.execute(sa.text(query_str))
|
|
388
391
|
|
|
389
392
|
values = ",".join((f"({id})" for id in l_ids))
|
mt/sql/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mtsql
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.9
|
|
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']
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
+
mt/sql/base.py,sha256=O3s_KtG5-eOX8xgS6Szl3NUSl2F2AdfDLPdZMBAxRVY,11970
|
|
3
|
+
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
|
+
mt/sql/psql.py,sha256=tzsIN2XyBJX8t7p0D2yXgEQwUTkTcDzllI4HunCfq3s,66345
|
|
5
|
+
mt/sql/redshift.py,sha256=Nve12tQ6_vO3M6yOpQQn3TkI1r4eDRBLsU0agOLRDvs,17037
|
|
6
|
+
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
7
|
+
mt/sql/version.py,sha256=Pd0M85F9m4wJ8-nQpQWktd1b4jAh9QDp-RcPesj3dQo,207
|
|
8
|
+
mtsql-1.11.9.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
9
|
+
mtsql-1.11.9.dist-info/METADATA,sha256=BRzmnKGKafqJzr96ja0jgoMbmBH81aHGV-zdp4bVfsI,579
|
|
10
|
+
mtsql-1.11.9.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
11
|
+
mtsql-1.11.9.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
12
|
+
mtsql-1.11.9.dist-info/RECORD,,
|
mtsql-1.11.7.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
-
mt/sql/base.py,sha256=1H5HQP9ZJAak9RYs4O2xTtm6dww0MJ_GxieAhZ49DDU,11871
|
|
3
|
-
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
|
-
mt/sql/psql.py,sha256=tzsIN2XyBJX8t7p0D2yXgEQwUTkTcDzllI4HunCfq3s,66345
|
|
5
|
-
mt/sql/redshift.py,sha256=Nve12tQ6_vO3M6yOpQQn3TkI1r4eDRBLsU0agOLRDvs,17037
|
|
6
|
-
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
7
|
-
mt/sql/version.py,sha256=1sh5-RDBD40ilM5zvs0F-2KA_AOdngu_w1qzzm3fyUU,207
|
|
8
|
-
mtsql-1.11.7.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
9
|
-
mtsql-1.11.7.dist-info/METADATA,sha256=T8sd7s8HDR48oX_-o4Evdw_uDjUs6WNi1N0VBMTMWvg,579
|
|
10
|
-
mtsql-1.11.7.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
11
|
-
mtsql-1.11.7.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
12
|
-
mtsql-1.11.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|