diff --git a/catalog-rest-service/src/main/resources/json/schema/type/filterPattern.json b/catalog-rest-service/src/main/resources/json/schema/type/filterPattern.json index 068cf694745..c1d560452d1 100644 --- a/catalog-rest-service/src/main/resources/json/schema/type/filterPattern.json +++ b/catalog-rest-service/src/main/resources/json/schema/type/filterPattern.json @@ -1,7 +1,7 @@ { "$id": "https://open-metadata.org/schema/type/filterPattern.json", "$schema": "http://json-schema.org/draft-07/schema#", - "title": "FilterPattern", + "title": "FilterPatternModel", "description": "OpenMetadata Ingestion Framework definition.", "type": "object", "definitions": { diff --git a/ingestion/src/metadata/ingestion/source/sql_source.py b/ingestion/src/metadata/ingestion/source/sql_source.py index 90d154fc07e..5f5fe04ea45 100644 --- a/ingestion/src/metadata/ingestion/source/sql_source.py +++ b/ingestion/src/metadata/ingestion/source/sql_source.py @@ -248,7 +248,8 @@ class SQLSource(Source[OMetaDatabaseAndTable]): self.status.scanned(fqn) # TODO centralize me - def get_table_fqn(self, service_name, db_name, schema_name, table_name) -> str: + @staticmethod + def get_table_fqn(service_name, db_name, schema_name, table_name) -> str: return ".".join((service_name, db_name, schema_name, table_name)) def next_record(self) -> Iterable[Entity]: @@ -388,8 +389,7 @@ class SQLSource(Source[OMetaDatabaseAndTable]): ) except NotImplementedError: view_definition = "" - fqn = self.get_table_fqn(self.config.serviceName, schema, view_name) - self.database_source_state.add(fqn) + table = Table( id=uuid.uuid4(), name=view_name, diff --git a/ingestion/src/metadata/utils/filters.py b/ingestion/src/metadata/utils/filters.py index c06f94e8cb5..8663f414a73 100644 --- a/ingestion/src/metadata/utils/filters.py +++ b/ingestion/src/metadata/utils/filters.py @@ -15,7 +15,7 @@ Helper that implements table and filter pattern logic import re from typing import List, Optional -from metadata.generated.schema.type.filterPattern import FilterPatternModel +from metadata.generated.schema.type.filterPattern import FilterPattern class InvalidPatternException(Exception): @@ -36,7 +36,7 @@ def validate_regex(regex_list: List[str]) -> None: raise InvalidPatternException(f"Invalid regex {regex}.") -def _filter(filter_pattern: Optional[FilterPatternModel], name: str) -> bool: +def _filter(filter_pattern: Optional[FilterPattern], name: str) -> bool: """ Return True if the name needs to be filtered, False otherwise @@ -74,7 +74,7 @@ def _filter(filter_pattern: Optional[FilterPatternModel], name: str) -> bool: def filter_by_schema( - schema_filter_pattern: Optional[FilterPatternModel], schema_name: str + schema_filter_pattern: Optional[FilterPattern], schema_name: str ) -> bool: """ Return True if the schema needs to be filtered, False otherwise @@ -89,7 +89,7 @@ def filter_by_schema( def filter_by_table( - table_filter_pattern: Optional[FilterPatternModel], table_name: str + table_filter_pattern: Optional[FilterPattern], table_name: str ) -> bool: """ Return True if the table needs to be filtered, False otherwise