berryworld 1.0.0.170917__py3-none-any.whl → 1.0.0.171476__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.
- berryworld/sql_conn.py +15 -12
- {berryworld-1.0.0.170917.dist-info → berryworld-1.0.0.171476.dist-info}/METADATA +1 -1
- {berryworld-1.0.0.170917.dist-info → berryworld-1.0.0.171476.dist-info}/RECORD +6 -6
- {berryworld-1.0.0.170917.dist-info → berryworld-1.0.0.171476.dist-info}/LICENSE +0 -0
- {berryworld-1.0.0.170917.dist-info → berryworld-1.0.0.171476.dist-info}/WHEEL +0 -0
- {berryworld-1.0.0.170917.dist-info → berryworld-1.0.0.171476.dist-info}/top_level.txt +0 -0
berryworld/sql_conn.py
CHANGED
|
@@ -258,7 +258,6 @@ class SQLConn:
|
|
|
258
258
|
:return: A DataFrame with the output columns requested if output is not None, else None
|
|
259
259
|
:param nullable: Used within bools2bits function to indicate which boolean column values to convert
|
|
260
260
|
:param commit_as_transaction: Indicate whether the connection will be done using the autocommit option or not
|
|
261
|
-
:param infer_int: Indicate whether the columns should be inferred to round to an integer
|
|
262
261
|
"""
|
|
263
262
|
if output is None:
|
|
264
263
|
output = []
|
|
@@ -272,8 +271,8 @@ class SQLConn:
|
|
|
272
271
|
# Mapping the date datatype columns for SQL
|
|
273
272
|
data = self.date_mapping_data_types(data)
|
|
274
273
|
|
|
275
|
-
# Infer integer datatype columns for SQL
|
|
276
|
-
data = self.int_mapping_data_types(data)
|
|
274
|
+
# # Infer integer datatype columns for SQL
|
|
275
|
+
# data = self.int_mapping_data_types(data)
|
|
277
276
|
|
|
278
277
|
# Mapping the boolean columns to bit
|
|
279
278
|
if bools2bits:
|
|
@@ -370,8 +369,8 @@ class SQLConn:
|
|
|
370
369
|
# Mapping the date datatype columns for SQL
|
|
371
370
|
data = self.date_mapping_data_types(data)
|
|
372
371
|
|
|
373
|
-
# Infer integer datatype columns for SQL
|
|
374
|
-
data = self.int_mapping_data_types(data)
|
|
372
|
+
# # Infer integer datatype columns for SQL
|
|
373
|
+
# data = self.int_mapping_data_types(data)
|
|
375
374
|
|
|
376
375
|
# Mapping the boolean columns to bit
|
|
377
376
|
if bools2bits:
|
|
@@ -484,8 +483,8 @@ class SQLConn:
|
|
|
484
483
|
# Mapping date type for SQL
|
|
485
484
|
data = self.date_mapping_data_types(data)
|
|
486
485
|
|
|
487
|
-
# Infer integer datatype columns for SQL
|
|
488
|
-
data = self.int_mapping_data_types(data)
|
|
486
|
+
# # Infer integer datatype columns for SQL
|
|
487
|
+
# data = self.int_mapping_data_types(data)
|
|
489
488
|
|
|
490
489
|
# create connection
|
|
491
490
|
self.open_write_connection(commit_as_transaction)
|
|
@@ -626,8 +625,8 @@ class SQLConn:
|
|
|
626
625
|
data = data[on_list + update_list]
|
|
627
626
|
data = self.date_mapping_data_types(data)
|
|
628
627
|
|
|
629
|
-
# Infer integer datatype columns for SQL
|
|
630
|
-
data = self.int_mapping_data_types(data)
|
|
628
|
+
# # Infer integer datatype columns for SQL
|
|
629
|
+
# data = self.int_mapping_data_types(data)
|
|
631
630
|
|
|
632
631
|
# create connection
|
|
633
632
|
self.open_write_connection(commit_as_transaction)
|
|
@@ -938,9 +937,13 @@ class SQLConn:
|
|
|
938
937
|
thres_ = 0.9
|
|
939
938
|
for col in data.columns:
|
|
940
939
|
try:
|
|
941
|
-
if ((~(data[col].isnull())) & (data[col].str.contains('.0', regex=False))).sum() / (
|
|
942
|
-
~data[col].isnull()).sum() > thres_:
|
|
943
|
-
|
|
940
|
+
if (((~(data[col].isnull())) & (data[col].str.contains('.0', regex=False))).sum() / (
|
|
941
|
+
~data[col].isnull()).sum() > thres_) & (~data[col].str.contains('{', regex=False)):
|
|
942
|
+
# Avoid converting datetime values
|
|
943
|
+
try:
|
|
944
|
+
pd.to_datetime(data[col])
|
|
945
|
+
except:
|
|
946
|
+
data[col] = data[col].str.replace('.0', '')
|
|
944
947
|
except:
|
|
945
948
|
continue
|
|
946
949
|
|
|
@@ -17,7 +17,7 @@ berryworld/pickle_management.py,sha256=O49ojVtTqYCT510rVRTbZWWaur_-5q3HSVG03Azn8
|
|
|
17
17
|
berryworld/postgres_connection.py,sha256=whKDnchd5Feqpmxpoh2vlyn36EKHR-dVEULYq0N_4wA,8287
|
|
18
18
|
berryworld/power_automate.py,sha256=9rDuRy0v-Ttq-SThid4lOB_tD4ibkyEmobiROpa--g4,25414
|
|
19
19
|
berryworld/sharepoint_con.py,sha256=TuH-Vxk1VxjTi7x80KFssf_J8YPLRXpV27RBaFZi37U,22254
|
|
20
|
-
berryworld/sql_conn.py,sha256=
|
|
20
|
+
berryworld/sql_conn.py,sha256=ZtHP09FvZrq058bvEJXiKW71EHa465pXYy5uYL-9qH4,47430
|
|
21
21
|
berryworld/sql_connection.py,sha256=u-2oNFC8cTP0nXkBGp62XjD06kukMFkwFMQ57CwsySQ,44364
|
|
22
22
|
berryworld/teams_logging.py,sha256=8NwXyWr4fLj7W6GzAm2nRQCGFDxibQpAHDHHD24FrP8,6997
|
|
23
23
|
berryworld/transportation_solver.py,sha256=AdJPekVNufweaKDZLWYIB9qSxeVti80LaoaD-4NCSjc,5038
|
|
@@ -29,8 +29,8 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
29
29
|
tests/test_allocation_config.py,sha256=e12l6fE9U57eSPS35g6ekJ_hol7-RHg89JV60_m1BlE,4633
|
|
30
30
|
tests/test_handy_mix_config.py,sha256=Un56mz9KJmdn4K4OwzHAHLSRzDU1Xv2nFrONNuzOG04,2594
|
|
31
31
|
tests/test_xml_parser.py,sha256=3QTlhFEd6KbK6nRFKZnc35tad6wqukTbe4QrFi8mr_8,859
|
|
32
|
-
berryworld-1.0.0.
|
|
33
|
-
berryworld-1.0.0.
|
|
34
|
-
berryworld-1.0.0.
|
|
35
|
-
berryworld-1.0.0.
|
|
36
|
-
berryworld-1.0.0.
|
|
32
|
+
berryworld-1.0.0.171476.dist-info/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
|
|
33
|
+
berryworld-1.0.0.171476.dist-info/METADATA,sha256=3INqJYfSPmqZUh_Hh691Yzujz3ltc4ITU3M1sUVtebQ,1107
|
|
34
|
+
berryworld-1.0.0.171476.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
35
|
+
berryworld-1.0.0.171476.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
|
|
36
|
+
berryworld-1.0.0.171476.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|