mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 17:04:54 +00:00
* Fix missing deprecation * Fix filterPattern generation
This commit is contained in:
parent
52abe152cd
commit
c6a785b219
@ -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": {
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user