Skip to content

Commit 3e19db8

Browse files
Akash VermaAkash Verma
authored andcommitted
Fix : pycheckstyle
1 parent 6e5dfe2 commit 3e19db8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • ingestion/src/metadata/ingestion/source/database/questdb

ingestion/src/metadata/ingestion/source/database/questdb/metadata.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from collections import defaultdict
1717
from collections.abc import Iterable
1818
from itertools import chain
19+
from typing import TYPE_CHECKING
1920

2021
from sqlalchemy.engine.reflection import Inspector
2122

@@ -44,6 +45,9 @@
4445
get_materialized_view_definition,
4546
query_tables,
4647
)
48+
49+
if TYPE_CHECKING:
50+
from metadata.ingestion.source.database.questdb.models import QuestDBTableRow
4751
from metadata.utils.logger import ingestion_logger
4852

4953
logger = ingestion_logger()
@@ -78,15 +82,14 @@ def create(cls, config_dict: dict, metadata: OpenMetadata, pipeline_name: str |
7882

7983
def __init__(self, config: WorkflowSource, metadata: OpenMetadata) -> None:
8084
super().__init__(config, metadata)
85+
self._tables_cache: defaultdict[str, dict[str, QuestDBTableRow]] = defaultdict(dict)
8186
try:
8287
rows = query_tables(self.connection)
83-
self._tables_cache: defaultdict[str, dict[str, object]] = defaultdict(dict)
8488
for row in rows:
8589
self._tables_cache[row.table_type][row.name] = row
8690
except Exception as exc:
8791
logger.debug(traceback.format_exc())
8892
logger.warning("Failed to load QuestDB table catalog: %s — partition details will be unavailable", exc)
89-
self._tables_cache = {}
9093

9194
def get_database_names(self) -> Iterable[str]:
9295
yield QUESTDB_DEFAULT_DATABASE

0 commit comments

Comments
 (0)