mtsql 1.11.12__py3-none-any.whl → 1.11.14__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 CHANGED
@@ -4,7 +4,7 @@ import re
4
4
  import uuid
5
5
  import sqlalchemy as sa
6
6
  import sqlalchemy.exc as se
7
- import psycopg2 as ps
7
+ import psycopg as ps
8
8
 
9
9
  from mt import tp, logg, pd, ctx
10
10
  from mt.halo import Halo
mt/sql/psql.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import sqlalchemy as sa
4
4
  import re
5
- import psycopg2 as ps
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 logger.scoped_debug(
1382
- "Comparing table: local '{}' <-> remote '{}'".format(
1383
- df_filepath, frame_sql_str
1384
- ),
1385
- curly=False,
1386
- ) if logger else ctx.nullcontext():
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 logger.scoped_debug(
1452
- "Range of '{}'".format(id_name), curly=False
1453
- ) if logger else ctx.nullcontext():
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 logger.scoped_debug(
1660
- "Writing table: local '{}' -> remote '{}'".format(df_filepath, frame_sql_str),
1661
- curly=False,
1662
- ) if logger else ctx.nullcontext():
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 logger.scoped_debug(
1903
- "Reading table: local '{}' <- remote '{}'".format(df_filepath, frame_sql_str),
1904
- curly=False,
1905
- ) if logger else ctx.nullcontext():
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,
@@ -0,0 +1,17 @@
1
+ from .main import *
2
+
3
+ __api__ = [
4
+ "rename_schema",
5
+ "get_frame_length",
6
+ "rename_table",
7
+ "vacuum_table",
8
+ "drop_table",
9
+ "rename_view",
10
+ "drop_view",
11
+ "rename_matview",
12
+ "refresh_matview",
13
+ "drop_matview",
14
+ "rename_column",
15
+ "drop_column",
16
+ "conform",
17
+ ]
@@ -4,25 +4,8 @@ import sqlalchemy as sa
4
4
  from mt import tp, np, pd, logg
5
5
  from mt.base import LogicError
6
6
 
7
- from .base import *
8
- from .psql import compliance_check
9
-
10
-
11
- __api__ = [
12
- "rename_schema",
13
- "get_frame_length",
14
- "rename_table",
15
- "vacuum_table",
16
- "drop_table",
17
- "rename_view",
18
- "drop_view",
19
- "rename_matview",
20
- "refresh_matview",
21
- "drop_matview",
22
- "rename_column",
23
- "drop_column",
24
- "conform",
25
- ]
7
+ from ..base import *
8
+ from ..psql import compliance_check
26
9
 
27
10
 
28
11
  # ----- simple functions -----
mt/sql/version.py CHANGED
@@ -1,5 +1,5 @@
1
1
  MAJOR_VERSION = 1
2
2
  MINOR_VERSION = 11
3
- PATCH_VERSION = 12
3
+ PATCH_VERSION = 14
4
4
  version = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
5
5
  __all__ = ['MAJOR_VERSION', 'MINOR_VERSION', 'PATCH_VERSION', 'version']
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: mtsql
3
- Version: 1.11.12
3
+ Version: 1.11.14
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: psycopg2-binary
14
- Requires-Dist: mtbase >=4.27.4
15
- Requires-Dist: mtpandas >=1.15
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,13 @@
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/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
6
+ mt/sql/version.py,sha256=J99AaumZyZLQUlKdA0VgUGPN56i_RovBX1bCTiFWKhI,208
7
+ mt/sql/redshift/__init__.py,sha256=CtVlNj4BfURLrDzeZyaG4vybAVbMkm_scCe1zTZkpDw,294
8
+ mt/sql/redshift/main.py,sha256=6dwnwNJ1F0_V9o2oqrSOkyN_pAMrgE01CCoqAjoyOME,17116
9
+ mtsql-1.11.14.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
10
+ mtsql-1.11.14.dist-info/METADATA,sha256=R1Qk8sEpSdGasf4hXd1dVVxbiSS1J7eaG7MjIOXO6BM,673
11
+ mtsql-1.11.14.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
12
+ mtsql-1.11.14.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
13
+ mtsql-1.11.14.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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,,