feat: Enhance activity session metrics handling and CSV import logic
Deploy Development / deploy (push) Successful in 51s
Build Test / pytest-backend (push) Successful in 9s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

- Updated the `ACTIVITY_SESSION_METRICS_EAV_AGENT_GUIDE` with new details on CSV import processes and EAV handling, improving documentation clarity.
- Refactored the `_import_activity` function to utilize `apply_activity_mapped_column_aliases`, ensuring proper mapping of training parameters and reducing redundancy.
- Introduced validation for numeric bounds in the `activity_csv_registry_updates_from_mapped` function, enhancing data integrity during CSV imports.
- Added new utility functions to manage column aliasing and streamline the upsert process for session metrics, preventing duplicate entries.
- Implemented unit tests to validate the new aliasing logic and ensure correct behavior during session metrics updates.
This commit is contained in:
Lars committed 2026-04-16 07:25:39 +02:00
1 parent ca8cee990b
commit cd29c7d433
7 files changed
+178 -59

No files matched your search

@@ -0,0 +1,14 @@
-- Migration 058: EAV-Zeilen entfernen, die nur activity_log-Spalten spiegeln (source_field gesetzt).
-- Kanon: merge_column_backed_and_eav_metrics liest diese Werte aus activity_log; Doppelzeilen vermeiden.
-- Date: 2026-04-15
DELETE FROM activity_session_metrics asm
USING training_parameters tp
WHERE asm.training_parameter_id = tp.id
AND tp.source_field IS NOT NULL
AND trim(tp.source_field) <> '';
DO $$
BEGIN
RAISE NOTICE 'Migration 058: removed EAV rows for column-backed training_parameters (source_field set)';
END $$;