wcp-library 1.3.7__tar.gz → 1.3.9__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.7 → wcp_library-1.3.9}/PKG-INFO +1 -1
- {wcp_library-1.3.7 → wcp_library-1.3.9}/pyproject.toml +1 -1
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/sql/postgres.py +12 -8
- {wcp_library-1.3.7 → wcp_library-1.3.9}/README.md +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/__init__.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/_credential_manager_asynchronous.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/_credential_manager_synchronous.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/api.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/ftp.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/internet.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/emailing.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/ftp/__init__.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/ftp/ftp.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/ftp/sftp.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/informatica.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/logging.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/selenium_helper.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/sql/__init__.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/sql/oracle.py +0 -0
- {wcp_library-1.3.7 → wcp_library-1.3.9}/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
|
|
@@ -317,8 +319,9 @@ class AsyncPostgresConnection(object):
|
|
317
319
|
:return: None
|
318
320
|
"""
|
319
321
|
|
320
|
-
self._session_pool = await
|
321
|
-
|
322
|
+
self._session_pool = await _async_connect_warehouse(self._username, self._password, self._hostname, self._port,
|
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
|
"""
|
@@ -413,6 +416,7 @@ class AsyncPostgresConnection(object):
|
|
413
416
|
|
414
417
|
async with self._session_pool.connection() as connection:
|
415
418
|
cursor = connection.cursor()
|
419
|
+
# await cursor.execute("set datestyle = 'SQL, DMY'")
|
416
420
|
if packed_data:
|
417
421
|
await cursor.execute(query, packed_data)
|
418
422
|
else:
|
File without changes
|
File without changes
|
File without changes
|
{wcp_library-1.3.7 → wcp_library-1.3.9}/wcp_library/credentials/_credential_manager_asynchronous.py
RENAMED
File without changes
|
{wcp_library-1.3.7 → wcp_library-1.3.9}/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
|