berryworld 1.0.0.199233__py3-none-any.whl → 1.0.0.199285__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/__init__.py CHANGED
@@ -24,4 +24,4 @@ from .teams_logging import TeamsLogging
24
24
  from .vivantio_logging import VivantioLogging
25
25
  from .snowflake_conn import SnowflakeConn
26
26
  from .logging import PythonLogs
27
- from .sql_connenction import SQLConnection, SQLConnectionPool, SQLPoolEngine
27
+ from .sql_connection import SQLConnection, SQLConnectionPool, SQLPoolEngine
berryworld/python_logs.py CHANGED
@@ -49,14 +49,13 @@ class ErrorLogs:
49
49
  """ Update log on success
50
50
  :param pipeline: Pipeline name being run. It must identify the process being executed uniquely
51
51
  """
52
- if not any(self.failure_type):
52
+ if len(self.failure_type) == 0:
53
53
  if pipeline is not None:
54
54
  self.pipeline = pipeline
55
55
  successful_columns = {'Successful': 1, 'Resolved': 1, 'Pipeline': self.pipeline, 'GuidKey': self.guid,
56
56
  'FinishedDate': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")}
57
57
  self.log_df = self.log_df.assign(**successful_columns)
58
58
  self.sql_con.insert(self.log_df, 'Staging', 'Logs', print_sql=self.print_sql)
59
- self.failure_type.append(True)
60
59
 
61
60
  Thread(target=self.trigger_merge_stored_procedure).start()
62
61
 
@@ -68,27 +67,19 @@ class ErrorLogs:
68
67
  :param critical: Indicate whether it should avoid sending successful logs
69
68
  :param proposed_solution: Proposed solution to the error message
70
69
  """
71
- save_failure = True
72
- if section is not None:
73
- if ((('prod' not in str(self.sql_con.server)) | ('prd' not in str(self.sql_con.server)))
74
- & (('connection' in str(section).lower()) & ('dw' in str(section).lower()))):
75
- print('Avoiding to report a connection DW error in a non-production environment')
76
- save_failure = False
77
-
78
- if save_failure:
79
- if pipeline is not None:
80
- self.pipeline = pipeline
81
- unsuccessful_columns = {'Successful': 0, 'Section': section, 'Pipeline': self.pipeline,
82
- 'GuidKey': self.guid, 'Critical': 1 if critical is True else 0,
83
- 'FinishedDate': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"),
84
- 'ErrorMessage': str(error_message).replace("'", '"')}
85
- self.log_df = self.log_df.assign(**unsuccessful_columns)
86
- if proposed_solution is not None:
87
- self.log_df = self.log_df.assign(**{'ProposedSolution': proposed_solution})
88
- self.sql_con.insert(self.log_df, 'Staging', 'Logs', print_sql=self.print_sql)
89
- self.failure_type.append(critical)
70
+ if pipeline is not None:
71
+ self.pipeline = pipeline
72
+ unsuccessful_columns = {'Successful': 0, 'Section': section, 'Pipeline': self.pipeline,
73
+ 'GuidKey': self.guid, 'Critical': 1 if critical is True else 0,
74
+ 'FinishedDate': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"),
75
+ 'ErrorMessage': str(error_message).replace("'", '"')}
76
+ self.log_df = self.log_df.assign(**unsuccessful_columns)
77
+ if proposed_solution is not None:
78
+ self.log_df = self.log_df.assign(**{'ProposedSolution': proposed_solution})
79
+ self.sql_con.insert(self.log_df, 'Staging', 'Logs', print_sql=self.print_sql)
80
+ self.failure_type.append(critical)
90
81
 
91
- Thread(target=self.trigger_merge_stored_procedure).start()
82
+ Thread(target=self.trigger_merge_stored_procedure).start()
92
83
 
93
84
  def trigger_merge_stored_procedure(self):
94
85
  """ Trigger the merge stored procedure to aggregate logs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: berryworld
3
- Version: 1.0.0.199233
3
+ Version: 1.0.0.199285
4
4
  Summary: Handy classes to improve ETL processes
5
5
  Home-page: https://www.berryworld.com
6
6
  Author: BerryWorld ltd
@@ -1,4 +1,4 @@
1
- berryworld/__init__.py,sha256=xYQwJeCZ2di85E0_O3Sx8AUsRhoT6USUxcPGJyCr-gY,1175
1
+ berryworld/__init__.py,sha256=yqZzic5XpvvMEd_JkQHSYN-a0rV2XbW76C_4NTV3Fck,1174
2
2
  berryworld/aks_logs.py,sha256=Gb2_cokiZbEX01Yoptd0MxpDociaug-GrXdwliyxFBo,2293
3
3
  berryworld/allocation_solver.py,sha256=asFtaCAze6-eHUGWXA0kAp67UBS-Upj1KKdrVLj_ttQ,8513
4
4
  berryworld/app_logs.py,sha256=MKzKPYd3JuPfOQNAapIgaeZeFHw1z_w2mbn9I6QCADE,4180
@@ -16,23 +16,23 @@ berryworld/microsoft_teams.py,sha256=8uPo0yku-euBj2VdzBoZCeX3IcsCCOqISLqaVZUVxfA
16
16
  berryworld/persistent_storage.py,sha256=L15kLyzN42T6UB1WAg8rFXJq3Mdb1M8Sw4P5YQaUN84,8711
17
17
  berryworld/pickle_management.py,sha256=5o6UuXBpTj23Jgpz6sj9V-vdcdWBK1xMEckWxT-Whj4,2436
18
18
  berryworld/power_automate.py,sha256=V86QEGG9H36DrDvod9Q6yp8OUu307hfYcXJhw06pYrA,27912
19
- berryworld/python_logs.py,sha256=xl7ckgsOnlCmvrDHYEoM3fTp2tC2MmQ8cetVnV4Gdpc,5966
19
+ berryworld/python_logs.py,sha256=c4zlgSHe3BALudnK_oxbVwJmo9KYdLuxYbiVmZOWX8s,5456
20
20
  berryworld/sharepoint_con.py,sha256=nmyZJIcaAKJ6Y-ti4gQbvzA_rRbrMGIxTDXe4eP-tiI,44950
21
21
  berryworld/snowflake_conn.py,sha256=L0ePgTKa3tvaxj88BZmsjS6cFp3ZU3rytw7S2jkuA-U,3161
22
22
  berryworld/sql_conn.py,sha256=6kUR3oLXweakz2IBc4zI1ZMqRoN8K6nbQneHhenM-7I,47668
23
- berryworld/sql_connenction.py,sha256=IJAOsQ7p0tMFEEucazmmkS3lNonf_YFWftyZ_kGPHj8,104150
23
+ berryworld/sql_connection.py,sha256=IJAOsQ7p0tMFEEucazmmkS3lNonf_YFWftyZ_kGPHj8,104150
24
24
  berryworld/teams_logging.py,sha256=8NwXyWr4fLj7W6GzAm2nRQCGFDxibQpAHDHHD24FrP8,6997
25
25
  berryworld/transportation_solver.py,sha256=tNc1JJk71azIBccdWVHbqcvXWhalOdKffv6HmBD6tG0,5014
26
26
  berryworld/verify_keys.py,sha256=X7VUHqYDklWPDO0bGVHIOXeLq5Qi4fZRZbHYw5x7UnA,4356
27
27
  berryworld/vivantio.py,sha256=QfZo0UKqkzVRg_LyiwivNd3aEup4TH57x4KxLZkCJwc,10627
28
28
  berryworld/vivantio_logging.py,sha256=ciy7gA4u3FrgUIpEBnMgocbNPp6jcu9TPoy-kLcrTZU,5736
29
29
  berryworld/xml_parser.py,sha256=HWD71NaTN3DaIOGT6Wzxs4CEsroFhGQwe9iPLIL80Co,957
30
- berryworld-1.0.0.199233.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
30
+ berryworld-1.0.0.199285.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
31
31
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  tests/test_allocation_config.py,sha256=e12l6fE9U57eSPS35g6ekJ_hol7-RHg89JV60_m1BlE,4633
33
33
  tests/test_handy_mix_config.py,sha256=Un56mz9KJmdn4K4OwzHAHLSRzDU1Xv2nFrONNuzOG04,2594
34
34
  tests/test_xml_parser.py,sha256=3QTlhFEd6KbK6nRFKZnc35tad6wqukTbe4QrFi8mr_8,859
35
- berryworld-1.0.0.199233.dist-info/METADATA,sha256=vitesuC1gZEZt6P-FmOGV18VVG4IB7GX8KTLTJJOJo4,1445
36
- berryworld-1.0.0.199233.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- berryworld-1.0.0.199233.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
38
- berryworld-1.0.0.199233.dist-info/RECORD,,
35
+ berryworld-1.0.0.199285.dist-info/METADATA,sha256=A5kwsq1VMBIOHhH1wQC0lqe2liBGFPC7Bp0aozgelxE,1445
36
+ berryworld-1.0.0.199285.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ berryworld-1.0.0.199285.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
38
+ berryworld-1.0.0.199285.dist-info/RECORD,,
File without changes