Skip to content

Commit

Permalink
Fix prefect (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
bram-vdberg authored Oct 30, 2024
1 parent 3b2ea60 commit 8d0e449
Show file tree
Hide file tree
Showing 3 changed files with 28 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
27 changes: 27 additions & 0 deletions .github/workflows/prefect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: prefect
on:
push:
branches: [ main ]
jobs:
deployment:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Deploy prefect deployment
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 8d0e449

Please sign in to comment.