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 prefect #122

Merged
merged 12 commits into from
Oct 30, 2024
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
Loading