From 86884a19a4934014f661787efe9280df3c267d27 Mon Sep 17 00:00:00 2001 From: janmatzek Date: Tue, 22 Jul 2025 10:29:54 +0200 Subject: [PATCH] SVS-1112 fix date dataset references --- .gitignore | 1 + scripts/custom_fields/input_processor.py | 2 +- tests/test_custom_fields/test_input_processor.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7857752..b6074e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea .vscode +.cursor .venv* venv/ .secrets diff --git a/scripts/custom_fields/input_processor.py b/scripts/custom_fields/input_processor.py index 5f18df6..315b20b 100644 --- a/scripts/custom_fields/input_processor.py +++ b/scripts/custom_fields/input_processor.py @@ -119,7 +119,7 @@ def _date_ref_from_field( multivalue=False, sources=[ CatalogDeclarativeReferenceSource( - column=custom_field.cf_id, + column=custom_field.cf_source_column, target=CatalogGrainIdentifier( id=custom_field.cf_id, type=CustomFieldType.DATE.value, diff --git a/tests/test_custom_fields/test_input_processor.py b/tests/test_custom_fields/test_input_processor.py index 5f57bcb..c92ef4b 100644 --- a/tests/test_custom_fields/test_input_processor.py +++ b/tests/test_custom_fields/test_input_processor.py @@ -127,7 +127,7 @@ def test_date_ref_from_field(mock_custom_field_date): ref = CustomFieldsDataProcessor._date_ref_from_field(mock_custom_field_date) assert ref.identifier.id == "date1" assert ref.sources - assert ref.sources[0].column == "date1" + assert ref.sources[0].column == "col_date1" assert ref.sources[0].data_type == ColumnDataType.DATE.value