From 7de540d5656d1357b205bb6e206f7b6586772862 Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 27 Sep 2024 14:30:21 +0200 Subject: [PATCH] fixed tests and linting --- semantic-model/shacl2flink/lib/shacl_properties_to_sql.py | 2 +- .../shacl2flink/tests/test_lib_shacl_properties_to_sql.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/semantic-model/shacl2flink/lib/shacl_properties_to_sql.py b/semantic-model/shacl2flink/lib/shacl_properties_to_sql.py index 449a2b1e..04ef8271 100644 --- a/semantic-model/shacl2flink/lib/shacl_properties_to_sql.py +++ b/semantic-model/shacl2flink/lib/shacl_properties_to_sql.py @@ -268,7 +268,7 @@ THEN '{{severity}}' ELSE 'ok' END AS severity, 'customer' customer, - CASE + CASE WHEN typ IS NOT NULL AND attr_typ IS NOT NULL AND NOT (SQL_DIALECT_CAST(val as DOUBLE) {{ operator }} {{ comparison_value }}) THEN 'Model validation for Property {{property_path}} failed for ' || this || '. Value ' || IFNULL(val, 'NULL') || ' is not {{ operator }} {{ comparison_value }}.' ELSE 'All ok' END as `text` diff --git a/semantic-model/shacl2flink/tests/test_lib_shacl_properties_to_sql.py b/semantic-model/shacl2flink/tests/test_lib_shacl_properties_to_sql.py index 8c3d312f..6d8fafc9 100644 --- a/semantic-model/shacl2flink/tests/test_lib_shacl_properties_to_sql.py +++ b/semantic-model/shacl2flink/tests/test_lib_shacl_properties_to_sql.py @@ -28,9 +28,12 @@ def test_lib_shacl_prroperties_to_sql(mock_utils, mock_configs, mock_yaml, mock_graph): def identity(klass): return klass + def identity2(klass, param): + return klass mock_utils.strip_class = identity mock_utils.class_to_obj_name = identity mock_utils.camelcase_to_snake_case = identity + mock_utils.process_sql_dialect = identity2 mock_configs.attributes_table_obj_name = 'attributes' mock_configs.rdf_table_obj_name = 'rdf' mock_configs.attributes_view_obj_name = 'attributes-view'