refactor(csv-import): Enhance nutrition data processing and template rendering
- Updated the nutrition import logic to utilize a new row processing specification, improving data aggregation and validation. - Refactored the template rendering process in the workflow executor to use Jinja2's Environment with ChainableUndefined for better handling of missing attributes. - Added backward-compatible shortcuts for accessing decision signals in node contexts, enhancing flexibility in template usage. - Introduced import row processing options in CSV templates, allowing for more customizable data handling during imports.
This commit is contained in:
1 parent
8b67f7ab55
commit
c0fcdea1fe
9 files changed
+357
-22
No files matched your search
@@ -23,6 +23,16 @@ MODULE_DEFINITIONS: Dict[str, Dict[str, Any]] = {
|
||||
},
|
||||
"duplicate_key": ["profile_id", "date"],
|
||||
"duplicate_strategy": "update",
|
||||
# Mehrere CSV-Zeilen pro Tag (z. B. pro Lebensmittel) → ein nutrition_log-Eintrag
|
||||
"import_row_processing_default": {
|
||||
"group_by": ["date"],
|
||||
"aggregates": {
|
||||
"kcal": "sum",
|
||||
"protein_g": "sum",
|
||||
"fat_g": "sum",
|
||||
"carbs_g": "sum",
|
||||
},
|
||||
},
|
||||
},
|
||||
"activity": {
|
||||
"table": "activity_log",
|
||||
|
||||
Reference in new issue
Block a user