Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmygithubaccount committed Aug 16, 2024
1 parent 6e1fd3b commit f3001d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/icarus/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@


# functions
def delta_table_filename(table_name: str) -> str:
return f"{table_name}.delta"


def delta_table_path(table_name: str) -> str:
return os.path.join(DATA_DIR, f"{table_name}.delta")
return os.path.join(DATA_DIR, delta_table_filename(table_name))


def read_table(table_name: str) -> ibis.Table:
Expand Down
6 changes: 5 additions & 1 deletion src/icarus/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
BUY_SELL_TABLE,
SOCIAL_MEDIA_TABLE,
)
from icarus.catalog import delta_table_filename
from icarus.investments.run import main as run_main
from icarus.synthetic_data.investments import (
gen_buy_sell_batch,
Expand Down Expand Up @@ -40,7 +41,9 @@ def check_raw_data_exists() -> bool:

def check_data_lake_exists() -> bool:
# check that the data lake exists
for table in [BUY_SELL_TABLE, SOCIAL_MEDIA_TABLE]:
tables = [BUY_SELL_TABLE, SOCIAL_MEDIA_TABLE]
tables = [delta_table_filename(table) for table in tables]
for table in tables:
if not os.path.exists(os.path.join(DATA_DIR, table)):
typer.echo("run `icarus run` first or use `--override`!")
return False
Expand Down Expand Up @@ -99,6 +102,7 @@ def clean_lake(
return

tables = [BUY_SELL_TABLE, SOCIAL_MEDIA_TABLE]
tables = [delta_table_filename(table) for table in tables]

for table in tables:
cmd = f"rm -rf {os.path.join(DATA_DIR, table)}/"
Expand Down

0 comments on commit f3001d8

Please sign in to comment.