Bug Fix für type_converter.py und executor.py
This commit is contained in:
1 parent
5b96bd4f75
commit
a9bd3faabb
5 files changed
+112
-11
No files matched your search
@@ -124,8 +124,8 @@ SELECT
|
||||
"Heart Rate Average (bpm)": "hr_avg"
|
||||
}'::JSONB,
|
||||
'{
|
||||
"start_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS", "extract": "date_and_time"},
|
||||
"end_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS"},
|
||||
"start_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS", "extract": "date_and_time", "flexible": true},
|
||||
"end_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS", "flexible": true},
|
||||
"duration_min": {"type": "duration", "format": "HH:MM:SS", "target_unit": "minutes"},
|
||||
"distance_km": {"type": "float", "decimal_separator": "."},
|
||||
"kcal_active": {"type": "float", "decimal_separator": "."},
|
||||
@@ -157,8 +157,8 @@ SELECT
|
||||
"Durchschnittliche Herzfrequenz (bpm)": "hr_avg"
|
||||
}'::JSONB,
|
||||
'{
|
||||
"start_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS", "extract": "date_and_time"},
|
||||
"end_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS"},
|
||||
"start_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS", "extract": "date_and_time", "flexible": true},
|
||||
"end_time": {"type": "datetime", "format": "yyyy-mm-dd HH:MM:SS", "flexible": true},
|
||||
"duration_min": {"type": "duration", "format": "HH:MM:SS", "target_unit": "minutes"},
|
||||
"distance_km": {"type": "float", "decimal_separator": ","},
|
||||
"kcal_active": {"type": "float", "decimal_separator": ","},
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
-- Apple Health Workout-CSV: Zeit oft ohne Sekunden (HH:MM); dateutil dayfirst bricht ISO YYYY-MM-DD.
|
||||
-- type_converter: zusätzliche Patterns + ISO-reihenfolge in _dateutil_parse.
|
||||
-- Bestehende System-Vorlagen: flexible für Start/End (idempotent).
|
||||
|
||||
UPDATE csv_field_mappings
|
||||
SET type_conversions = jsonb_set(
|
||||
jsonb_set(
|
||||
COALESCE(type_conversions, '{}'::jsonb),
|
||||
'{start_time}',
|
||||
COALESCE(type_conversions->'start_time', '{}'::jsonb) || '{"flexible": true}'::jsonb,
|
||||
true
|
||||
),
|
||||
'{end_time}',
|
||||
COALESCE(type_conversions->'end_time', '{}'::jsonb) || '{"flexible": true}'::jsonb,
|
||||
true
|
||||
)
|
||||
WHERE is_system = true
|
||||
AND profile_id IS NULL
|
||||
AND module = 'activity'
|
||||
AND mapping_name IN (
|
||||
'Apple Health Workout Export (English)',
|
||||
'Apple Health Workout Export (Deutsch)'
|
||||
)
|
||||
AND type_conversions IS NOT NULL
|
||||
AND type_conversions ? 'start_time'
|
||||
AND type_conversions ? 'end_time';
|
||||
Reference in new issue
Block a user