ipulse-shared-core-ftredge 2.38__tar.gz → 2.39__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.
Potentially problematic release.
This version of ipulse-shared-core-ftredge might be problematic. Click here for more details.
- {ipulse_shared_core_ftredge-2.38/src/ipulse_shared_core_ftredge.egg-info → ipulse_shared_core_ftredge-2.39}/PKG-INFO +1 -1
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/setup.py +1 -1
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/__init__.py +3 -2
- ipulse_shared_core_ftredge-2.39/src/ipulse_shared_core_ftredge/utils_common.py +24 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/utils_templates_and_schemas.py +28 -34
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39/src/ipulse_shared_core_ftredge.egg-info}/PKG-INFO +1 -1
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge.egg-info/SOURCES.txt +1 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/LICENCE +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/README.md +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/pyproject.toml +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/setup.cfg +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/enums/__init__.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/enums/enums_common_utils.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/enums/enums_data_eng.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/enums/enums_module_fincore.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/enums/enums_modules.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/__init__.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/audit_log_firestore.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/organisation.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/pulse_enums.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/resource_catalog_item.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/user_auth.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/user_profile.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/user_profile_update.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/models/user_status.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/tests/__init__.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/tests/test.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge/utils_gcp.py +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge.egg-info/dependency_links.txt +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge.egg-info/requires.txt +0 -0
- {ipulse_shared_core_ftredge-2.38 → ipulse_shared_core_ftredge-2.39}/src/ipulse_shared_core_ftredge.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.39
|
|
4
4
|
Summary: Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.
|
|
5
5
|
Home-page: https://github.com/TheFutureEdge/ipulse_shared_core
|
|
6
6
|
Author: Russlan Ramdowar
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='ipulse_shared_core_ftredge',
|
|
5
|
-
version='2.
|
|
5
|
+
version='2.39',
|
|
6
6
|
package_dir={'': 'src'}, # Specify the source directory
|
|
7
7
|
packages=find_packages(where='src'), # Look for packages in 'src'
|
|
8
8
|
install_requires=[
|
|
@@ -4,8 +4,9 @@ from .utils_gcp import (setup_gcp_logger_and_error_report,
|
|
|
4
4
|
read_csv_from_gcs, read_json_from_gcs,
|
|
5
5
|
write_csv_to_gcs, write_json_to_gcs)
|
|
6
6
|
from .utils_templates_and_schemas import (create_bigquery_schema_from_json,
|
|
7
|
-
update_check_with_schema_template
|
|
8
|
-
|
|
7
|
+
update_check_with_schema_template)
|
|
8
|
+
from .utils_common import (create_custom_notice, create_exception_notice)
|
|
9
|
+
|
|
9
10
|
from .enums import (NoticeSeverity, Unit, Frequency,
|
|
10
11
|
Module, SubModule, BaseDataCategory,
|
|
11
12
|
FinCoreCategory, FincCoreSubCategory,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
# pylint: disable=missing-function-docstring
|
|
3
|
+
# pylint: disable=logging-fstring-interpolation
|
|
4
|
+
# pylint: disable=line-too-long
|
|
5
|
+
|
|
6
|
+
def create_custom_notice(severity, subject, message):
|
|
7
|
+
return {
|
|
8
|
+
"severity_code": severity.value,
|
|
9
|
+
"severity_name": severity.name,
|
|
10
|
+
"subject": subject,
|
|
11
|
+
"message": message
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def create_exception_notice(severity, exception_code,exception_message, exception_traceback=None, subject=None, message=None):
|
|
16
|
+
return {
|
|
17
|
+
"severity_code": severity.value,
|
|
18
|
+
"severity_name": severity.name,
|
|
19
|
+
"subject": subject,
|
|
20
|
+
"message": message,
|
|
21
|
+
"exception_code": exception_code,
|
|
22
|
+
"exception_message": exception_message,
|
|
23
|
+
"exception_traceback": exception_traceback
|
|
24
|
+
}
|
|
@@ -6,14 +6,8 @@
|
|
|
6
6
|
import datetime
|
|
7
7
|
from google.cloud import bigquery
|
|
8
8
|
from ipulse_shared_core_ftredge.enums.enums_common_utils import NoticeSeverity
|
|
9
|
+
from ipulse_shared_core_ftredge.utils_common import create_custom_notice
|
|
9
10
|
|
|
10
|
-
def create_data_check_notice(severity, field_name, message):
|
|
11
|
-
return {
|
|
12
|
-
"severity_code": severity.value,
|
|
13
|
-
"severity_name": severity.name,
|
|
14
|
-
"subject": field_name,
|
|
15
|
-
"message": message
|
|
16
|
-
}
|
|
17
11
|
|
|
18
12
|
def create_bigquery_schema_from_json(json_schema):
|
|
19
13
|
schema = []
|
|
@@ -67,9 +61,9 @@ def update_check_with_schema_template(updates, schema, dt_ts_to_str=True, check_
|
|
|
67
61
|
valid_updates[field_name] = value
|
|
68
62
|
|
|
69
63
|
elif mode == "REQUIRED":
|
|
70
|
-
notice=
|
|
71
|
-
field_name,
|
|
72
|
-
f"Required field '{field_name}' is missing in the updates.")
|
|
64
|
+
notice=create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
65
|
+
subject=field_name,
|
|
66
|
+
message=f"Required field '{field_name}' is missing in the updates.")
|
|
73
67
|
|
|
74
68
|
notices.append(notice)
|
|
75
69
|
|
|
@@ -88,13 +82,13 @@ def handle_date_fields(field_name, value, dt_ts_to_str):
|
|
|
88
82
|
return value, None
|
|
89
83
|
return parsed_date, None
|
|
90
84
|
except ValueError:
|
|
91
|
-
return None,
|
|
92
|
-
field_name,
|
|
93
|
-
|
|
85
|
+
return None, create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
86
|
+
subject=field_name,
|
|
87
|
+
message=f"Expected a DATE in YYYY-MM-DD format but got {value}.")
|
|
94
88
|
else:
|
|
95
|
-
return None,
|
|
96
|
-
field_name,
|
|
97
|
-
f"Expected a DATE or YYYY-MM-DD str format but got {value} of type {type(value).__name__}.")
|
|
89
|
+
return None, create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
90
|
+
subject=field_name,
|
|
91
|
+
message= f"Expected a DATE or YYYY-MM-DD str format but got {value} of type {type(value).__name__}.")
|
|
98
92
|
|
|
99
93
|
|
|
100
94
|
def handle_timestamp_fields(field_name, value, dt_ts_to_str):
|
|
@@ -110,21 +104,21 @@ def handle_timestamp_fields(field_name, value, dt_ts_to_str):
|
|
|
110
104
|
return value, None
|
|
111
105
|
return parsed_datetime, None
|
|
112
106
|
except ValueError:
|
|
113
|
-
return None,
|
|
114
|
-
field_name,
|
|
115
|
-
f"Expected ISO format TIMESTAMP but got {value}.")
|
|
107
|
+
return None, create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
108
|
+
subject=field_name,
|
|
109
|
+
message= f"Expected ISO format TIMESTAMP but got {value}.")
|
|
116
110
|
else:
|
|
117
|
-
return None,
|
|
118
|
-
field_name,
|
|
119
|
-
f"Expected ISO format TIMESTAMP but got {value} of type {type(value).__name__}.")
|
|
111
|
+
return None, create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
112
|
+
subject=field_name,
|
|
113
|
+
message= f"Expected ISO format TIMESTAMP but got {value} of type {type(value).__name__}.")
|
|
120
114
|
|
|
121
115
|
|
|
122
116
|
def check_and_truncate_length(field_name, value, max_length):
|
|
123
117
|
"""Checks and truncates the length of string fields if they exceed the max length."""
|
|
124
118
|
if isinstance(value, str) and len(value) > max_length:
|
|
125
|
-
return value[:max_length],
|
|
126
|
-
|
|
127
|
-
f"Field exceeds max length: {len(value)}/{max_length}. Truncating.")
|
|
119
|
+
return value[:max_length], create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_RECOMMENDED,
|
|
120
|
+
subject= field_name,
|
|
121
|
+
message= f"Field exceeds max length: {len(value)}/{max_length}. Truncating.")
|
|
128
122
|
|
|
129
123
|
return value, None
|
|
130
124
|
|
|
@@ -132,24 +126,24 @@ def check_and_truncate_length(field_name, value, max_length):
|
|
|
132
126
|
|
|
133
127
|
def handle_type_conversion(field_type, field_name, value):
|
|
134
128
|
if field_type == "STRING" and not isinstance(value, str):
|
|
135
|
-
return str(value),
|
|
136
|
-
field_name,
|
|
137
|
-
f"Expected STRING but got {value} of type {type(value).__name__}.")
|
|
129
|
+
return str(value), create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
130
|
+
subject=field_name,
|
|
131
|
+
message= f"Expected STRING but got {value} of type {type(value).__name__}.")
|
|
138
132
|
|
|
139
133
|
if field_type == "INT64" and not isinstance(value, int):
|
|
140
134
|
try:
|
|
141
135
|
return int(value), None
|
|
142
136
|
except ValueError:
|
|
143
|
-
return None,
|
|
144
|
-
|
|
145
|
-
|
|
137
|
+
return None, create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
138
|
+
subject= field_name,
|
|
139
|
+
message=f"Expected INTEGER, but got {value} of type {type(value).__name__}.")
|
|
146
140
|
if field_type == "FLOAT64" and not isinstance(value, float):
|
|
147
141
|
try:
|
|
148
142
|
return float(value), None
|
|
149
143
|
except ValueError:
|
|
150
|
-
return None,
|
|
151
|
-
field_name,
|
|
152
|
-
|
|
144
|
+
return None, create_custom_notice(severity=NoticeSeverity.WARNING_ACTION_REQUIRED,
|
|
145
|
+
subject=field_name,
|
|
146
|
+
message=f"Expected FLOAT, but got {value} of type {type(value).__name__}.")
|
|
153
147
|
if field_type == "BOOL" and not isinstance(value, bool):
|
|
154
148
|
return bool(value), None
|
|
155
149
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.39
|
|
4
4
|
Summary: Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.
|
|
5
5
|
Home-page: https://github.com/TheFutureEdge/ipulse_shared_core
|
|
6
6
|
Author: Russlan Ramdowar
|
|
@@ -3,6 +3,7 @@ README.md
|
|
|
3
3
|
pyproject.toml
|
|
4
4
|
setup.py
|
|
5
5
|
src/ipulse_shared_core_ftredge/__init__.py
|
|
6
|
+
src/ipulse_shared_core_ftredge/utils_common.py
|
|
6
7
|
src/ipulse_shared_core_ftredge/utils_gcp.py
|
|
7
8
|
src/ipulse_shared_core_ftredge/utils_templates_and_schemas.py
|
|
8
9
|
src/ipulse_shared_core_ftredge.egg-info/PKG-INFO
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|