Skip to content

Commit

Permalink
Fix prefect
Browse files Browse the repository at this point in the history
  • Loading branch information
bram-vdberg committed Oct 29, 2024
1 parent 3b2ea60 commit f49aa91
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- uses: actions/setup-python@v2
with:
python-version: '3.12'

- env:
PREFECT_API_URL: ${{ secrets.PREFECT_API_URL }}
- run: |
python -m pip install --upgrade pip
pip install -r requirements/prefect.txt
pip install -r requirements/prod.txt
prefect config set PREFECT_API_URL=$PREFECT_API_URL
python -m src.deploy_prefect.deployment
25 changes: 25 additions & 0 deletions .github/workflows/prefect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: deploy

on:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/setup-python@v2
with:
python-version: '3.12'
- env:
PREFECT_API_URL: ${{ secrets.PREFECT_API_URL }}
- run: |
python -m pip install --upgrade pip
pip install -r requirements/prefect.txt
pip install -r requirements/prod.txt
prefect config set PREFECT_API_URL=$PREFECT_API_URL
python -m src.deploy_prefect.deployment
2 changes: 1 addition & 1 deletion src/deploy_prefect/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def update_aggregate_query(table_name: str) -> None:
insertion_point = insertion_point = sql_query.rfind(")")
updated_sql_query = (
sql_query[:insertion_point].strip()
+ f"\n UNION ALL\n SELECT * FROM {table_name}\n"
+ f"\n UNION ALL\n SELECT * FROM dune.cowprotocol.dataset_{table_name}\n"
+ sql_query[insertion_point:]
)
dune.update_query( # type: ignore[attr-defined]
Expand Down

0 comments on commit f49aa91

Please sign in to comment.