Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmygithubaccount committed Aug 21, 2024
1 parent a443468 commit d347d1d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
paths:
- 'justfile'
- 'website/**'
- '_quarto.yml'
- 'dev-requirements.txt'
- '.github/workflows/cicd.yaml'

Expand Down
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ build:

# setup
setup:
@pip install uv
@uv venv
@uv venv --python 3.12
@. .venv/bin/activate
@uv pip install --upgrade --resolution=highest -r dev-requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion src/icarus/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

# typer apps
app = typer.Typer(help="Icarus", **TYPER_KWARGS)
app = typer.Typer(help="Icarus: soaring beyond limits.", **TYPER_KWARGS)
clean_app = typer.Typer(help="Clean the data lake.", **TYPER_KWARGS)

# add subcommands
Expand Down
2 changes: 2 additions & 0 deletions src/icarus/investments/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
)

# set extracted_at timestamp
# note we don't use ibis.now() to ensure it's the same...
# ...for all tables/rows on a given run
extracted_at = datetime.utcnow().isoformat()


Expand Down
18 changes: 17 additions & 1 deletion src/icarus/investments/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,26 @@ def main():
extract_buy_sell_t = extract_buy_sell()
extract_social_media_t = extract_social_media()

# data validation
assert (
extract_buy_sell_t.count().to_pyarrow().as_py() > 0
), "No extracted buy/sell data"
assert (
extract_social_media_t.count().to_pyarrow().as_py() > 0
), "No extracted social media data"

# transform
transform_buy_sell_t = transform_buy_sell(extract_buy_sell_t)
transform_social_media_t = transform_social_media(extract_social_media_t)

# load?
# data validation
assert (
transform_buy_sell_t.count().to_pyarrow().as_py() > 0
), "No transformed buy/sell data"
assert (
transform_social_media_t.count().to_pyarrow().as_py() > 0
), "No transformed social media data"

# load
catalog.write_table(transform_buy_sell_t, BUY_SELL_TABLE)
catalog.write_table(transform_social_media_t, SOCIAL_MEDIA_TABLE)

0 comments on commit d347d1d

Please sign in to comment.