wcp-library 1.1.9__tar.gz → 1.2.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.1.9 → wcp_library-1.2.1}/PKG-INFO +1 -1
- {wcp_library-1.1.9 → wcp_library-1.2.1}/pyproject.toml +1 -1
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_sql/oracle.py +11 -7
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_sql/postgres.py +11 -7
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/sql/oracle.py +11 -7
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/sql/postgres.py +11 -7
- {wcp_library-1.1.9 → wcp_library-1.2.1}/README.md +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/__init__.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_credentials/__init__.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_credentials/api.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_credentials/oracle.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_credentials/postgres.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/async_sql/__init__.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/credentials/ftp.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/emailing.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/ftp/__init__.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/ftp/ftp.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/ftp/sftp.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/informatica.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/logging.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/selenium_helper.py +0 -0
- {wcp_library-1.1.9 → wcp_library-1.2.1}/wcp_library/sql/__init__.py +0 -0
@@ -1,6 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from typing import Optional
|
3
3
|
|
4
|
+
import numpy as np
|
4
5
|
import pandas as pd
|
5
6
|
import oracledb
|
6
7
|
from oracledb import AsyncConnectionPool
|
@@ -204,14 +205,17 @@ class AsyncOracleConnection(object):
|
|
204
205
|
bindList.append(':' + column)
|
205
206
|
bind = ', '.join(bindList)
|
206
207
|
|
207
|
-
main_dict = dfObj.to_dict('records')
|
208
208
|
if remove_nan:
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
209
|
+
dfObj = dfObj.replace({np.nan: None})
|
210
|
+
main_dict = dfObj.to_dict('records')
|
211
|
+
|
212
|
+
# if remove_nan:
|
213
|
+
# for val, item in enumerate(main_dict):
|
214
|
+
# for sub_item, value in item.items():
|
215
|
+
# if pd.isna(value):
|
216
|
+
# main_dict[val][sub_item] = None
|
217
|
+
# else:
|
218
|
+
# main_dict[val][sub_item] = value
|
215
219
|
|
216
220
|
query = """INSERT INTO {} ({}) VALUES ({})""".format(outputTableName, col, bind)
|
217
221
|
await self.execute_many(query, main_dict)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from typing import Optional
|
3
3
|
|
4
|
+
import numpy as np
|
4
5
|
import pandas as pd
|
5
6
|
from psycopg.sql import SQL
|
6
7
|
from psycopg_pool import AsyncConnectionPool
|
@@ -187,14 +188,17 @@ class AsyncPostgresConnection(object):
|
|
187
188
|
param_list.append(f"%({column})s")
|
188
189
|
params = ', '.join(param_list)
|
189
190
|
|
190
|
-
main_dict = dfObj.to_dict('records')
|
191
191
|
if remove_nan:
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
192
|
+
dfObj = dfObj.replace({np.nan: None})
|
193
|
+
main_dict = dfObj.to_dict('records')
|
194
|
+
|
195
|
+
# if remove_nan:
|
196
|
+
# for val, item in enumerate(main_dict):
|
197
|
+
# for sub_item, value in item.items():
|
198
|
+
# if pd.isna(value):
|
199
|
+
# main_dict[val][sub_item] = None
|
200
|
+
# else:
|
201
|
+
# main_dict[val][sub_item] = value
|
198
202
|
|
199
203
|
query = """INSERT INTO {} ({}) VALUES ({})""".format(outputTableName, col, params)
|
200
204
|
await self.execute_many(query, main_dict)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from typing import Optional
|
3
3
|
|
4
|
+
import numpy as np
|
4
5
|
import pandas as pd
|
5
6
|
import oracledb
|
6
7
|
from oracledb import ConnectionPool
|
@@ -208,14 +209,17 @@ class OracleConnection(object):
|
|
208
209
|
bindList.append(':' + column)
|
209
210
|
bind = ', '.join(bindList)
|
210
211
|
|
211
|
-
main_dict = dfObj.to_dict('records')
|
212
212
|
if remove_nan:
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
213
|
+
dfObj = dfObj.replace({np.nan: None})
|
214
|
+
main_dict = dfObj.to_dict('records')
|
215
|
+
|
216
|
+
# if remove_nan:
|
217
|
+
# for val, item in enumerate(main_dict):
|
218
|
+
# for sub_item, value in item.items():
|
219
|
+
# if pd.isna(value):
|
220
|
+
# main_dict[val][sub_item] = None
|
221
|
+
# else:
|
222
|
+
# main_dict[val][sub_item] = value
|
219
223
|
|
220
224
|
query = """INSERT INTO {} ({}) VALUES ({})""".format(outputTableName, col, bind)
|
221
225
|
self.execute_many(query, main_dict)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from typing import Optional
|
3
3
|
|
4
|
+
import numpy as np
|
4
5
|
import pandas as pd
|
5
6
|
from psycopg.sql import SQL
|
6
7
|
from psycopg_pool import ConnectionPool
|
@@ -187,14 +188,17 @@ class PostgresConnection(object):
|
|
187
188
|
param_list.append(f"%({column})s")
|
188
189
|
params = ', '.join(param_list)
|
189
190
|
|
190
|
-
main_dict = dfObj.to_dict('records')
|
191
191
|
if remove_nan:
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
192
|
+
dfObj = dfObj.replace({np.nan: None})
|
193
|
+
main_dict = dfObj.to_dict('records')
|
194
|
+
|
195
|
+
# if remove_nan:
|
196
|
+
# for val, item in enumerate(main_dict):
|
197
|
+
# for sub_item, value in item.items():
|
198
|
+
# if pd.isna(value):
|
199
|
+
# main_dict[val][sub_item] = None
|
200
|
+
# else:
|
201
|
+
# main_dict[val][sub_item] = value
|
198
202
|
|
199
203
|
query = """INSERT INTO {} ({}) VALUES ({})""".format(outputTableName, col, params)
|
200
204
|
self.execute_many(query, main_dict)
|
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
|
File without changes
|
File without changes
|
File without changes
|