mtsql 1.11.12__py3-none-any.whl → 1.11.13__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 +1 -1
- mt/sql/psql.py +36 -18
- mt/sql/version.py +1 -1
- {mtsql-1.11.12.dist-info → mtsql-1.11.13.dist-info}/METADATA +10 -6
- mtsql-1.11.13.dist-info/RECORD +12 -0
- {mtsql-1.11.12.dist-info → mtsql-1.11.13.dist-info}/WHEEL +1 -1
- mtsql-1.11.12.dist-info/RECORD +0 -12
- {mtsql-1.11.12.dist-info → mtsql-1.11.13.dist-info}/LICENSE +0 -0
- {mtsql-1.11.12.dist-info → mtsql-1.11.13.dist-info}/top_level.txt +0 -0
mt/sql/base.py
CHANGED
mt/sql/psql.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import sqlalchemy as sa
|
|
4
4
|
import re
|
|
5
|
-
import
|
|
5
|
+
import psycopg as ps
|
|
6
6
|
import sqlalchemy.exc as se
|
|
7
7
|
from tqdm.auto import tqdm # nice progress bar
|
|
8
8
|
|
|
@@ -1378,12 +1378,16 @@ def comparesync_table(
|
|
|
1378
1378
|
"""
|
|
1379
1379
|
frame_sql_str = frame_sql(table_name, schema=schema)
|
|
1380
1380
|
|
|
1381
|
-
with
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1381
|
+
with (
|
|
1382
|
+
logger.scoped_debug(
|
|
1383
|
+
"Comparing table: local '{}' <-> remote '{}'".format(
|
|
1384
|
+
df_filepath, frame_sql_str
|
|
1385
|
+
),
|
|
1386
|
+
curly=False,
|
|
1387
|
+
)
|
|
1388
|
+
if logger
|
|
1389
|
+
else ctx.nullcontext()
|
|
1390
|
+
):
|
|
1387
1391
|
# make sure the folder containing the CSV file exists
|
|
1388
1392
|
data_dir = path.dirname(df_filepath)
|
|
1389
1393
|
path.make_dirs(data_dir)
|
|
@@ -1448,9 +1452,11 @@ def comparesync_table(
|
|
|
1448
1452
|
id_name, text, hash_name, frame_sql_str
|
|
1449
1453
|
)
|
|
1450
1454
|
|
|
1451
|
-
with
|
|
1452
|
-
"Range of '{}'".format(id_name), curly=False
|
|
1453
|
-
|
|
1455
|
+
with (
|
|
1456
|
+
logger.scoped_debug("Range of '{}'".format(id_name), curly=False)
|
|
1457
|
+
if logger
|
|
1458
|
+
else ctx.nullcontext()
|
|
1459
|
+
):
|
|
1454
1460
|
qsql = "SELECT min({}) AS val FROM ({}) ct_t0".format(
|
|
1455
1461
|
id_name, query_str
|
|
1456
1462
|
)
|
|
@@ -1656,10 +1662,16 @@ def writesync_table(
|
|
|
1656
1662
|
)
|
|
1657
1663
|
engine_ro = conn_ro
|
|
1658
1664
|
frame_sql_str = frame_sql(table_name, schema=schema)
|
|
1659
|
-
with
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1665
|
+
with (
|
|
1666
|
+
logger.scoped_debug(
|
|
1667
|
+
"Writing table: local '{}' -> remote '{}'".format(
|
|
1668
|
+
df_filepath, frame_sql_str
|
|
1669
|
+
),
|
|
1670
|
+
curly=False,
|
|
1671
|
+
)
|
|
1672
|
+
if logger
|
|
1673
|
+
else ctx.nullcontext()
|
|
1674
|
+
):
|
|
1663
1675
|
(
|
|
1664
1676
|
local_df,
|
|
1665
1677
|
remote_md5_df,
|
|
@@ -1899,10 +1911,16 @@ def readsync_table(
|
|
|
1899
1911
|
file. If no background thread is needed, None is returned.
|
|
1900
1912
|
"""
|
|
1901
1913
|
frame_sql_str = frame_sql(table_name, schema=schema)
|
|
1902
|
-
with
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1914
|
+
with (
|
|
1915
|
+
logger.scoped_debug(
|
|
1916
|
+
"Reading table: local '{}' <- remote '{}'".format(
|
|
1917
|
+
df_filepath, frame_sql_str
|
|
1918
|
+
),
|
|
1919
|
+
curly=False,
|
|
1920
|
+
)
|
|
1921
|
+
if logger
|
|
1922
|
+
else ctx.nullcontext()
|
|
1923
|
+
):
|
|
1906
1924
|
(
|
|
1907
1925
|
local_df,
|
|
1908
1926
|
remote_md5_df,
|
mt/sql/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: mtsql
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.13
|
|
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']
|
|
@@ -10,7 +10,11 @@ License-File: LICENSE
|
|
|
10
10
|
Requires-Dist: sqlalchemy
|
|
11
11
|
Requires-Dist: tzlocal
|
|
12
12
|
Requires-Dist: tqdm
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist: mtbase
|
|
15
|
-
Requires-Dist: mtpandas
|
|
16
|
-
|
|
13
|
+
Requires-Dist: psycopg[binary]
|
|
14
|
+
Requires-Dist: mtbase>=4.27.4
|
|
15
|
+
Requires-Dist: mtpandas>=1.15
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: project-url
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: summary
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
+
mt/sql/base.py,sha256=9aTVudlH9_HEq_v7uHV6p6asDuxMidQwAlCRSXDofvY,11967
|
|
3
|
+
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
|
+
mt/sql/psql.py,sha256=AmXdDVRbvzK7hWK8kysrdiXkAUwSdWmh_OqlWdoNOig,66578
|
|
5
|
+
mt/sql/redshift.py,sha256=Xtxy4pmqVfiXARGNOmq2dEG9eRLmaINRJIXvctLIJHg,17389
|
|
6
|
+
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
7
|
+
mt/sql/version.py,sha256=5xdsdzxCPdh8w0Uk-c8PpVzxpHxQ7WZwo24H-ppGeY8,208
|
|
8
|
+
mtsql-1.11.13.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
9
|
+
mtsql-1.11.13.dist-info/METADATA,sha256=BOUWCwRLsg5F1-8cu6i06li1nDxwZmlTm8Yrj9feunM,673
|
|
10
|
+
mtsql-1.11.13.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
11
|
+
mtsql-1.11.13.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
12
|
+
mtsql-1.11.13.dist-info/RECORD,,
|
mtsql-1.11.12.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
-
mt/sql/base.py,sha256=qR9ggHU7ae_c3Zj6bm6feFe8EQymGjwAw9rQZ_j0GOo,11968
|
|
3
|
-
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
|
-
mt/sql/psql.py,sha256=tzsIN2XyBJX8t7p0D2yXgEQwUTkTcDzllI4HunCfq3s,66345
|
|
5
|
-
mt/sql/redshift.py,sha256=Xtxy4pmqVfiXARGNOmq2dEG9eRLmaINRJIXvctLIJHg,17389
|
|
6
|
-
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
7
|
-
mt/sql/version.py,sha256=pqOt4EFHe69mP9LpnUwSE536jna7oEvyHugaySEaxx0,208
|
|
8
|
-
mtsql-1.11.12.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
9
|
-
mtsql-1.11.12.dist-info/METADATA,sha256=QeUuCizrVY8r3CPnD4gXPzQbGdyU-T3pds_LZYqM37o,580
|
|
10
|
-
mtsql-1.11.12.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
|
11
|
-
mtsql-1.11.12.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
12
|
-
mtsql-1.11.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|