ipulse-shared-core-ftredge 2.25__tar.gz → 2.27__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.25/src/ipulse_shared_core_ftredge.egg-info → ipulse_shared_core_ftredge-2.27}/PKG-INFO +1 -1
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/setup.py +1 -1
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/utils_templates_and_schemas.py +50 -33
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27/src/ipulse_shared_core_ftredge.egg-info}/PKG-INFO +1 -1
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/LICENCE +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/README.md +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/pyproject.toml +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/setup.cfg +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/__init__.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/__init__.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/audit_log_firestore.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/organisation.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/pulse_enums.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/resource_catalog_item.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/user_auth.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/user_profile.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/user_profile_update.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/models/user_status.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/tests/__init__.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/tests/test.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge/utils_gcp.py +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge.egg-info/SOURCES.txt +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge.egg-info/dependency_links.txt +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/src/ipulse_shared_core_ftredge.egg-info/requires.txt +0 -0
- {ipulse_shared_core_ftredge-2.25 → ipulse_shared_core_ftredge-2.27}/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.27
|
|
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.27',
|
|
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=[
|
|
@@ -22,50 +22,67 @@ def update_check_with_dict_template(template, updates, logger):
|
|
|
22
22
|
|
|
23
23
|
def update_check_with_schema_template(updates, schema, logger, dt_ts_to_str=True, check_max_length=True):
|
|
24
24
|
"""Ensure Update dict corresponds to the config schema, ensuring proper formats and lengths."""
|
|
25
|
-
|
|
25
|
+
valid_updates = {}
|
|
26
26
|
schema_dict = {field["name"]: field for field in schema}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"""Ensure Update dict corresponds to the config schema, ensuring proper formats and lengths."""
|
|
29
|
+
valid_updates = {}
|
|
30
|
+
schema_dict = {field["name"]: field for field in schema}
|
|
31
|
+
|
|
32
|
+
# Process updates to conform to the schema
|
|
33
|
+
for field in schema:
|
|
34
|
+
field_name = field["name"]
|
|
35
|
+
field_type = field["type"]
|
|
36
|
+
mode = field["mode"]
|
|
37
|
+
|
|
38
|
+
if field_name in updates:
|
|
39
|
+
value = updates[field_name]
|
|
31
40
|
|
|
41
|
+
# Handle date and timestamp formatting
|
|
32
42
|
if dt_ts_to_str:
|
|
33
43
|
if field_type == "DATE":
|
|
34
44
|
value = handle_date_fields(field_name, value, logger)
|
|
35
45
|
elif field_type == "TIMESTAMP":
|
|
36
46
|
value = handle_timestamp_fields(field_name, value, logger)
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
# Check and handle max length restriction
|
|
49
|
+
if check_max_length and "max_length" in field:
|
|
50
|
+
value = check_and_truncate_length(field_name, value, field["max_length"], logger)
|
|
40
51
|
|
|
41
|
-
#
|
|
42
|
-
if field_type == "STRING"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
# Validate and convert types
|
|
53
|
+
if field_type == "STRING":
|
|
54
|
+
if not isinstance(value, str):
|
|
55
|
+
logger.warning(f"Field {field_name} expected to be a string but got {type(value).__name__}.")
|
|
56
|
+
value = str(value)
|
|
57
|
+
elif field_type == "INT64":
|
|
58
|
+
if not isinstance(value, int):
|
|
59
|
+
logger.warning(f"Field {field_name} expected to be an int but got {type(value).__name__}.")
|
|
60
|
+
try:
|
|
61
|
+
value = int(value)
|
|
62
|
+
except ValueError:
|
|
63
|
+
logger.warning(f"Cannot convert value {value} of field {field_name} to int.")
|
|
64
|
+
continue
|
|
65
|
+
elif field_type == "FLOAT64":
|
|
66
|
+
if not isinstance(value, float):
|
|
67
|
+
logger.warning(f"Field {field_name} expected to be a float but got {type(value).__name__}.")
|
|
68
|
+
try:
|
|
69
|
+
value = float(value)
|
|
70
|
+
except ValueError:
|
|
71
|
+
logger.warning(f"Cannot convert value {value} of field {field_name} to float.")
|
|
72
|
+
continue
|
|
73
|
+
elif field_type == "BOOL":
|
|
74
|
+
if not isinstance(value, bool):
|
|
75
|
+
logger.warning(f"Field {field_name} expected to be a bool but got {type(value).__name__}.")
|
|
76
|
+
value = bool(value)
|
|
77
|
+
|
|
78
|
+
# Only add to the dictionary if value is not None or the field is required
|
|
79
|
+
if value is not None or mode == "REQUIRED":
|
|
80
|
+
valid_updates[field_name] = value
|
|
81
|
+
|
|
82
|
+
elif mode == "REQUIRED":
|
|
83
|
+
logger.warning(f"Required field '{field_name}' is missing in the updates.")
|
|
67
84
|
|
|
68
|
-
return
|
|
85
|
+
return valid_updates
|
|
69
86
|
|
|
70
87
|
|
|
71
88
|
def check_updates_formatting(updates, schema, logger, dt_ts_to_str, check_max_length):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.27
|
|
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
|
|
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
|