Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1104: Improve lakeinfo structure and reporting #1319

Merged
merged 11 commits into from
Jul 3, 2024
10 changes: 4 additions & 6 deletions pdr_backend/cli/cli_module_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
from enforce_typing import enforce_types

from pdr_backend.cli.cli_arguments_lake import LAKE_SUBCOMMANDS, LakeArgParser

from pdr_backend.lake.duckdb_data_store import DuckDBDataStore
from pdr_backend.lake.etl import ETL
from pdr_backend.lake.gql_data_factory import GQLDataFactory
from pdr_backend.lake.lake_info import LakeInfo
from pdr_backend.lake.lake_validate import LakeValidate
from pdr_backend.lake.duckdb_data_store import DuckDBDataStore
from pdr_backend.lake.table import drop_tables_from_st
from pdr_backend.lake_info.lake_info import LakeInfo
from pdr_backend.ppss.ppss import PPSS
from pdr_backend.util.time_types import UnixTimeMs

Expand Down Expand Up @@ -59,8 +57,8 @@ def do_lake_describe(args, ppss):

@enforce_types
def do_lake_validate(_, ppss):
lake_validate = LakeValidate(ppss)
lake_validate.run()
lake_info = LakeInfo(ppss)
lake_info.run_validation()


@enforce_types
Expand Down
2 changes: 1 addition & 1 deletion pdr_backend/cli/test/test_cli_module_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_do_lake_validate():

ppss = Mock()

with patch("pdr_backend.cli.cli_module_lake.LakeValidate") as mock_lake_info:
with patch("pdr_backend.cli.cli_module_lake.LakeInfo") as mock_lake_info:
do_lake_validate(args, ppss)

mock_lake_info.assert_called_once_with(ppss)
Expand Down
47 changes: 0 additions & 47 deletions pdr_backend/lake/lake_validate.py

This file was deleted.

258 changes: 0 additions & 258 deletions pdr_backend/lake/renderers/html.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
import polars as pl
from polars.dataframe.frame import DataFrame

from pdr_backend.lake_info.overview import TableViewsOverview
from pdr_backend.util.time_types import UnixTimeMs


class CliRenderer:
def __init__(self, lake_info):
self.lake_info = lake_info
def __init__(self, overview: TableViewsOverview):
self.overview = overview

def print_table_info(self, source_name: str, source: Dict[str, DataFrame]):
table_summary = DataFrame()
Expand Down Expand Up @@ -87,17 +88,17 @@ def print_table_info(self, source_name: str, source: Dict[str, DataFrame]):
print(table_summary)

def show(self):
if len(self.lake_info.all_table_names) == 0:
if len(self.overview.all_table_names) == 0:
print("No Lake Tables")
else:
print("Lake Tables:")
print(self.lake_info.all_table_names)
self.print_table_info("tables", self.lake_info.table_info)
print(self.overview.all_table_names)
self.print_table_info("tables", self.overview.table_info)

if len(self.lake_info.all_view_names) == 0:
if len(self.overview.all_view_names) == 0:
print("Great - No views in Lake.")
else:
print("=" * 80)
print("Lake Views:")
print(self.lake_info.all_view_names)
print(self.overview.all_view_names)
self.print_table_info("views", self.lake_info.view_info)
Loading
Loading