diff --git a/metadata-ingestion/docs/sources/dbt/dbt.md b/metadata-ingestion/docs/sources/dbt/dbt.md index 8e9b410bb48b47..43ced13c3b1f8d 100644 --- a/metadata-ingestion/docs/sources/dbt/dbt.md +++ b/metadata-ingestion/docs/sources/dbt/dbt.md @@ -39,7 +39,7 @@ meta_mapping: config: separator: "," documentation_link: - match: "https?\:\/\/\w+((\:\d+)?\/\S*)?" + match: "(?:https?)?\:\/\/\w*[^#]*" operation: "add_doc_link" config: link: {{ $match }} diff --git a/metadata-ingestion/tests/unit/test_mapping.py b/metadata-ingestion/tests/unit/test_mapping.py index d6c60ce427456c..5c258f16535f88 100644 --- a/metadata-ingestion/tests/unit/test_mapping.py +++ b/metadata-ingestion/tests/unit/test_mapping.py @@ -236,12 +236,12 @@ def test_operation_processor_advanced_matching_tags(): def test_operation_processor_institutional_memory(): raw_props = { - "documentation_link": "test.com", + "documentation_link": "https://test.com/documentation#ignore-this", } processor = OperationProcessor( operation_defs={ "documentation_link": { - "match": ".*", + "match": r"(?:https?)?\:\/\/\w*[^#]*", "operation": "add_doc_link", "config": {"link": "{{ $match }}", "description": "test"}, }, @@ -252,18 +252,18 @@ def test_operation_processor_institutional_memory(): doc_link_aspect: InstitutionalMemoryClass = aspect_map["add_doc_link"] - assert doc_link_aspect.elements[0].url == "test.com" + assert doc_link_aspect.elements[0].url == "https://test.com/documentation" assert doc_link_aspect.elements[0].description == "test" def test_operation_processor_institutional_memory_no_description(): raw_props = { - "documentation_link": "test.com", + "documentation_link": "test.com/documentation#ignore-this", } processor = OperationProcessor( operation_defs={ "documentation_link": { - "match": ".*", + "match": r"(?:https?)?\:\/\/\w*[^#]*", "operation": "add_doc_link", "config": {"link": "{{ $match }}"}, },