wcp-library 1.3.8__tar.gz → 1.4.1__tar.gz
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.
- {wcp_library-1.3.8 → wcp_library-1.4.1}/PKG-INFO +1 -1
- {wcp_library-1.3.8 → wcp_library-1.4.1}/pyproject.toml +1 -1
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/sql/postgres.py +12 -7
- {wcp_library-1.3.8 → wcp_library-1.4.1}/README.md +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/__init__.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/_credential_manager_asynchronous.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/_credential_manager_synchronous.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/api.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/ftp.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/internet.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/emailing.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/ftp/__init__.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/ftp/ftp.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/ftp/sftp.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/informatica.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/logging.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/selenium_helper.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/sql/__init__.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/sql/oracle.py +0 -0
- {wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/time.py +0 -0
@@ -3,6 +3,7 @@ from typing import Optional
|
|
3
3
|
|
4
4
|
import numpy as np
|
5
5
|
import pandas as pd
|
6
|
+
from psycopg.conninfo import make_conninfo
|
6
7
|
from psycopg.sql import SQL
|
7
8
|
from psycopg_pool import AsyncConnectionPool, ConnectionPool
|
8
9
|
|
@@ -26,10 +27,11 @@ def _connect_warehouse(username: str, password: str, hostname: str, port: int, d
|
|
26
27
|
:return: session_pool
|
27
28
|
"""
|
28
29
|
|
29
|
-
|
30
|
+
conn_string = f"dbname={database} user={username} password={password} host={hostname} port={port}"
|
31
|
+
conninfo = make_conninfo(conn_string)
|
30
32
|
|
31
33
|
session_pool = ConnectionPool(
|
32
|
-
conninfo=
|
34
|
+
conninfo=conninfo,
|
33
35
|
min_size=min_connections,
|
34
36
|
max_size=max_connections,
|
35
37
|
open=True
|
@@ -52,14 +54,14 @@ async def _async_connect_warehouse(username: str, password: str, hostname: str,
|
|
52
54
|
:return: session_pool
|
53
55
|
"""
|
54
56
|
|
55
|
-
|
57
|
+
conn_string = f"dbname={database} user={username} password={password} host={hostname} port={port}"
|
58
|
+
conninfo = make_conninfo(conn_string)
|
56
59
|
|
57
60
|
session_pool = AsyncConnectionPool(
|
58
|
-
conninfo=
|
61
|
+
conninfo=conninfo,
|
59
62
|
min_size=min_connections,
|
60
|
-
max_size=max_connections
|
63
|
+
max_size=max_connections
|
61
64
|
)
|
62
|
-
await session_pool.open()
|
63
65
|
return session_pool
|
64
66
|
|
65
67
|
|
@@ -319,6 +321,7 @@ class AsyncPostgresConnection(object):
|
|
319
321
|
|
320
322
|
self._session_pool = await _async_connect_warehouse(self._username, self._password, self._hostname, self._port,
|
321
323
|
self._database, self.min_connections, self.max_connections)
|
324
|
+
await self._session_pool.open()
|
322
325
|
|
323
326
|
async def set_user(self, credentials_dict: dict) -> None:
|
324
327
|
"""
|
@@ -399,7 +402,8 @@ class AsyncPostgresConnection(object):
|
|
399
402
|
"""
|
400
403
|
|
401
404
|
async with self._session_pool.connection() as connection:
|
402
|
-
|
405
|
+
cursor = connection.cursor()
|
406
|
+
await cursor.executemany(query, dictionary)
|
403
407
|
|
404
408
|
@async_retry
|
405
409
|
async def fetch_data(self, query: SQL | str, packed_data=None):
|
@@ -413,6 +417,7 @@ class AsyncPostgresConnection(object):
|
|
413
417
|
|
414
418
|
async with self._session_pool.connection() as connection:
|
415
419
|
cursor = connection.cursor()
|
420
|
+
# await cursor.execute("set datestyle = 'SQL, DMY'")
|
416
421
|
if packed_data:
|
417
422
|
await cursor.execute(query, packed_data)
|
418
423
|
else:
|
File without changes
|
File without changes
|
File without changes
|
{wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/_credential_manager_asynchronous.py
RENAMED
File without changes
|
{wcp_library-1.3.8 → wcp_library-1.4.1}/wcp_library/credentials/_credential_manager_synchronous.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|