Skip to content

Commit

Permalink
Initialization fix for missing tables
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Nov 23, 2023
1 parent 95cd21e commit 2597e34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/brad/data_stats/postgres_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .estimator import Estimator

from brad.blueprint import Blueprint
from brad.config.engine import Engine
from brad.config.file import ConfigFile
from brad.config.strings import (
base_table_name_from_source,
Expand Down Expand Up @@ -195,6 +196,10 @@ async def _get_table_sizes_direct(self) -> Dict[str, int]:
table_counts = {}

for table in self._blueprint.tables():
locations = self._blueprint.get_table_locations(table.name)
if Engine.Aurora not in locations:
logger.warning("Not fetching size of %s.", table.name)
continue
query = f"SELECT COUNT(*) FROM {table.name}"
logger.debug("PostgresEstimator running: %s", query)
await self._cursor.execute(query)
Expand Down

0 comments on commit 2597e34

Please sign in to comment.