ipulse-shared-core-ftredge 2.37__tar.gz → 2.38__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.

Files changed (30) hide show
  1. {ipulse_shared_core_ftredge-2.37/src/ipulse_shared_core_ftredge.egg-info → ipulse_shared_core_ftredge-2.38}/PKG-INFO +1 -1
  2. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/setup.py +1 -1
  3. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/utils_templates_and_schemas.py +44 -35
  4. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38/src/ipulse_shared_core_ftredge.egg-info}/PKG-INFO +1 -1
  5. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/LICENCE +0 -0
  6. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/README.md +0 -0
  7. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/pyproject.toml +0 -0
  8. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/setup.cfg +0 -0
  9. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/__init__.py +0 -0
  10. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/enums/__init__.py +0 -0
  11. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/enums/enums_common_utils.py +0 -0
  12. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/enums/enums_data_eng.py +0 -0
  13. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/enums/enums_module_fincore.py +0 -0
  14. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/enums/enums_modules.py +0 -0
  15. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/__init__.py +0 -0
  16. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/audit_log_firestore.py +0 -0
  17. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/organisation.py +0 -0
  18. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/pulse_enums.py +0 -0
  19. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/resource_catalog_item.py +0 -0
  20. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/user_auth.py +0 -0
  21. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/user_profile.py +0 -0
  22. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/user_profile_update.py +0 -0
  23. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/models/user_status.py +0 -0
  24. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/tests/__init__.py +0 -0
  25. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/tests/test.py +0 -0
  26. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge/utils_gcp.py +0 -0
  27. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge.egg-info/SOURCES.txt +0 -0
  28. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge.egg-info/dependency_links.txt +0 -0
  29. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/src/ipulse_shared_core_ftredge.egg-info/requires.txt +0 -0
  30. {ipulse_shared_core_ftredge-2.37 → ipulse_shared_core_ftredge-2.38}/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.37
3
+ Version: 2.38
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.37',
5
+ version='2.38',
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=[
@@ -36,29 +36,32 @@ def update_check_with_schema_template(updates, schema, dt_ts_to_str=True, check_
36
36
  field_name = field["name"]
37
37
  field_type = field["type"]
38
38
  mode = field["mode"]
39
+
40
+ # Initialize notice to None at the start of each field processing
41
+ notice = None
39
42
 
40
43
  if field_name in updates:
41
44
  value = updates[field_name]
42
45
 
43
46
  # Handle date and timestamp formatting
44
- if dt_ts_to_str:
45
- if field_type == "DATE":
46
- value, notice = handle_date_fields(field_name, value)
47
- elif field_type == "TIMESTAMP":
48
- value,notice = handle_timestamp_fields(field_name, value)
49
- if notice:
50
- notices.append(notice)
47
+
48
+ # Validate and potentially convert date and timestamp fields
49
+ if field_type == "DATE":
50
+ value, notice = handle_date_fields(field_name, value, dt_ts_to_str)
51
+ elif field_type == "TIMESTAMP":
52
+ value, notice = handle_timestamp_fields(field_name, value, dt_ts_to_str)
53
+ elif field_type in ["STRING", "INT64", "FLOAT64", "BOOL"]:
54
+ value, notice = handle_type_conversion(field_type, field_name, value )
55
+
56
+ if notice:
57
+ notices.append(notice)
58
+
51
59
  # Check and handle max length restriction
52
60
  if check_max_length and "max_length" in field:
53
61
  value,notice = check_and_truncate_length(field_name, value, field["max_length"])
54
62
  if notice:
55
63
  notices.append(notice)
56
- # Validate and convert types
57
- if field_type in ["STRING", "INT64", "FLOAT64", "BOOL"]:
58
- value, notice = handle_type_conversion(field_type, field_name, value )
59
- if notice:
60
- notices.append(notice)
61
-
64
+
62
65
  # Only add to the dictionary if value is not None or the field is required
63
66
  if value is not None or mode == "REQUIRED":
64
67
  valid_updates[field_name] = value
@@ -72,42 +75,48 @@ def update_check_with_schema_template(updates, schema, dt_ts_to_str=True, check_
72
75
 
73
76
  return valid_updates, notices
74
77
 
75
-
76
- def handle_date_fields(field_name, value):
77
- """Handles date fields, ensuring they are in the correct format.
78
- Return is a tuple of the formatted date and a notice."""
78
+ def handle_date_fields(field_name, value, dt_ts_to_str):
79
+ """Handles date fields, ensuring they are in the correct format and optionally converts them to string."""
79
80
  if isinstance(value, datetime.date):
80
- return value.strftime("%Y-%m-%d"), None
81
+ if dt_ts_to_str:
82
+ return value.strftime("%Y-%m-%d"), None
83
+ return value, None
81
84
  elif isinstance(value, str):
82
85
  try:
83
- datetime.datetime.strptime(value, "%Y-%m-%d")
84
- return value, None
86
+ parsed_date = datetime.datetime.strptime(value, "%Y-%m-%d").date()
87
+ if dt_ts_to_str:
88
+ return value, None
89
+ return parsed_date, None
85
90
  except ValueError:
86
91
  return None, create_data_check_notice(NoticeSeverity.WARNING_ACTION_REQUIRED,
87
- field_name,
88
- f"Expected a DATE or YYYY-MM-DD str format but got {value} of type {type(value).__name__}.")
92
+ field_name,
93
+ f"Expected a DATE in YYYY-MM-DD format but got {value}.")
89
94
  else:
90
95
  return None, create_data_check_notice(NoticeSeverity.WARNING_ACTION_REQUIRED,
91
- field_name,
92
- f"Expected a DATE or YYYY-MM-DD str format but got {value} of type {type(value).__name__}.")
96
+ field_name,
97
+ f"Expected a DATE or YYYY-MM-DD str format but got {value} of type {type(value).__name__}.")
93
98
 
94
99
 
95
- def handle_timestamp_fields(field_name, value):
96
- """Handles timestamp fields, ensuring they are in the correct format."""
100
+ def handle_timestamp_fields(field_name, value, dt_ts_to_str):
101
+ """Handles timestamp fields, ensuring they are in the correct format and optionally converts them to ISO format string."""
97
102
  if isinstance(value, datetime.datetime):
98
- return value.isoformat(), None
103
+ if dt_ts_to_str:
104
+ return value.isoformat(), None
105
+ return value, None
99
106
  elif isinstance(value, str):
100
107
  try:
101
- datetime.datetime.fromisoformat(value)
102
- return value, None
108
+ parsed_datetime = datetime.datetime.fromisoformat(value)
109
+ if dt_ts_to_str:
110
+ return value, None
111
+ return parsed_datetime, None
103
112
  except ValueError:
104
- return None, create_data_check_notice(NoticeSeverity.WARNING_ACTION_REQUIRED,
105
- field_name,
106
- f"Expected ISO format TIMESTAMP but got {value} of type {type(value).__name__}.")
113
+ return None, create_data_check_notice(NoticeSeverity.WARNING_ACTION_REQUIRED,
114
+ field_name,
115
+ f"Expected ISO format TIMESTAMP but got {value}.")
107
116
  else:
108
- return None, create_data_check_notice(NoticeSeverity.WARNING_ACTION_REQUIRED,
109
- field_name,
110
- f"Expected ISO format TIMESTAMP but got {value} of type {type(value).__name__}.")
117
+ return None, create_data_check_notice(NoticeSeverity.WARNING_ACTION_REQUIRED,
118
+ field_name,
119
+ f"Expected ISO format TIMESTAMP but got {value} of type {type(value).__name__}.")
111
120
 
112
121
 
113
122
  def check_and_truncate_length(field_name, value, max_length):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ipulse_shared_core_ftredge
3
- Version: 2.37
3
+ Version: 2.38
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