wcp-library 1.6.5__tar.gz → 1.6.7__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.6.5 → wcp_library-1.6.7}/PKG-INFO +1 -1
- {wcp_library-1.6.5 → wcp_library-1.6.7}/pyproject.toml +1 -1
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/ftp/ftp.py +1 -1
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/sql/__init__.py +7 -3
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/sql/oracle.py +5 -4
- {wcp_library-1.6.5 → wcp_library-1.6.7}/README.md +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/__init__.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/browser_automation/__init__.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/browser_automation/browser.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/browser_automation/interactions.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/_credential_manager_asynchronous.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/_credential_manager_synchronous.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/api.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/ftp.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/internet.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/emailing.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/ftp/__init__.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/ftp/sftp.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/informatica.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/logging.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/selenium/__init__.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/selenium/_selenium_driver.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/selenium/selenium_helper.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/sql/postgres.py +0 -0
- {wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/time.py +0 -0
@@ -17,7 +17,7 @@ class FTP:
|
|
17
17
|
|
18
18
|
self._ftp_factory: ftputil.session.session_factory = ftputil.session.session_factory(port=self.port)
|
19
19
|
self.ftp_connection: Optional[ftputil.FTPHost] = None if not (self._username and self._password) \
|
20
|
-
else ftputil.FTPHost(self.host, self._username, self._password
|
20
|
+
else ftputil.FTPHost(self.host, self._username, self._password) #, session_factory=self._ftp_factory)
|
21
21
|
|
22
22
|
def login(self, username: str, password: str) -> None:
|
23
23
|
"""
|
@@ -25,8 +25,10 @@ def retry(func: callable) -> callable:
|
|
25
25
|
return func(self, *args, **kwargs)
|
26
26
|
except (oracledb.OperationalError, oracledb.DatabaseError, psycopg.OperationalError) as e:
|
27
27
|
if isinstance(e, (oracledb.OperationalError, oracledb.DatabaseError, psycopg.OperationalError, psycopg.DatabaseError)):
|
28
|
-
error_obj, = e.args
|
29
|
-
if error_obj
|
28
|
+
(error_obj,) = e.args
|
29
|
+
if isinstance(error_obj, str):
|
30
|
+
raise e
|
31
|
+
elif error_obj.full_code in self.retry_error_codes and self._retry_count < self.retry_limit:
|
30
32
|
self._retry_count += 1
|
31
33
|
logger.debug("Oracle connection error")
|
32
34
|
logger.debug(error_obj.message)
|
@@ -55,7 +57,9 @@ def async_retry(func: callable) -> callable:
|
|
55
57
|
except (oracledb.OperationalError, oracledb.DatabaseError, psycopg.OperationalError) as e:
|
56
58
|
if isinstance(e, (oracledb.OperationalError, oracledb.DatabaseError, psycopg.OperationalError, psycopg.DatabaseError)):
|
57
59
|
error_obj, = e.args
|
58
|
-
if error_obj
|
60
|
+
if isinstance(error_obj, str):
|
61
|
+
raise e
|
62
|
+
elif error_obj.full_code in self.retry_error_codes and self._retry_count < self.retry_limit:
|
59
63
|
self._retry_count += 1
|
60
64
|
logger.debug(f"{self._db_service} connection error")
|
61
65
|
logger.debug(error_obj.message)
|
@@ -9,6 +9,7 @@ from oracledb import ConnectionPool, AsyncConnectionPool, Connection, AsyncConne
|
|
9
9
|
from wcp_library.sql import retry, async_retry
|
10
10
|
|
11
11
|
logger = logging.getLogger(__name__)
|
12
|
+
oracledb.defaults.fetch_lobs = False
|
12
13
|
|
13
14
|
|
14
15
|
def _connect_warehouse(username: str, password: str, hostname: str, port: int, database: str, min_connections: int,
|
@@ -44,7 +45,7 @@ def _connect_warehouse(username: str, password: str, hostname: str, port: int, d
|
|
44
45
|
connection = oracledb.connect(
|
45
46
|
user=username,
|
46
47
|
password=password,
|
47
|
-
dsn=oracledb.makedsn(hostname, port,
|
48
|
+
dsn=oracledb.makedsn(hostname, port, service_name=database)
|
48
49
|
)
|
49
50
|
return connection
|
50
51
|
|
@@ -82,7 +83,7 @@ async def _async_connect_warehouse(username: str, password: str, hostname: str,
|
|
82
83
|
connection = await oracledb.connect_async(
|
83
84
|
user=username,
|
84
85
|
password=password,
|
85
|
-
dsn=oracledb.makedsn(hostname, port,
|
86
|
+
dsn=oracledb.makedsn(hostname, port, service_name=database)
|
86
87
|
)
|
87
88
|
return connection
|
88
89
|
|
@@ -113,7 +114,7 @@ class OracleConnection(object):
|
|
113
114
|
|
114
115
|
self._retry_count = 0
|
115
116
|
self.retry_limit = 50
|
116
|
-
self.retry_error_codes = ['ORA-01033', 'DPY-6005', 'DPY-4011', 'ORA-08103']
|
117
|
+
self.retry_error_codes = ['ORA-01033', 'DPY-6005', 'DPY-4011', 'ORA-08103', 'ORA-04021']
|
117
118
|
|
118
119
|
@retry
|
119
120
|
def _connect(self) -> None:
|
@@ -392,7 +393,7 @@ class AsyncOracleConnection(object):
|
|
392
393
|
|
393
394
|
self._retry_count = 0
|
394
395
|
self.retry_limit = 50
|
395
|
-
self.retry_error_codes = ['ORA-01033', 'DPY-6005', 'DPY-4011', 'ORA-08103']
|
396
|
+
self.retry_error_codes = ['ORA-01033', 'DPY-6005', 'DPY-4011', 'ORA-08103', 'ORA-04021']
|
396
397
|
|
397
398
|
@async_retry
|
398
399
|
async def _connect(self) -> None:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{wcp_library-1.6.5 → wcp_library-1.6.7}/wcp_library/credentials/_credential_manager_asynchronous.py
RENAMED
File without changes
|
{wcp_library-1.6.5 → wcp_library-1.6.7}/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
|