Skip to content

Commit faf3104

Browse files
committed
fix(ci): fix workflows
1 parent 25df911 commit faf3104

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,14 @@ jobs:
6464
with:
6565
convention-name: conventionalcommits
6666

67-
- name: Install Conda Dependencies
68-
uses: conda-incubator/setup-miniconda@v3
67+
- uses: conda-incubator/setup-miniconda@v3
6968
with:
70-
miniconda-version: "latest"
71-
mamba-version: "*"
69+
miniforge-version: latest
7270
environment-file: conda/env.yaml
7371
channels: conda-forge,nodefaults
7472
activate-environment: alertflow
75-
use-mamba: true
76-
miniforge-variant: Mambaforge
73+
auto-update-conda: true
74+
conda-solver: libmamba
7775

7876
- name: Create environment variables file
7977
run: |

alertflow/dags/satellite-weather/brasil.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"""
1717

1818
import os
19-
from pathlib import Path
2019
from datetime import date, timedelta
2120
from itertools import chain
21+
from pathlib import Path
2222

2323
import pendulum
2424
from airflow import DAG
@@ -45,7 +45,7 @@
4545
dag_id="COPERNICUS_BRASIL",
4646
description="ETL of weather data for Brazil",
4747
tags=["Brasil", "Copernicus"],
48-
schedule="@monthly",
48+
schedule="@daily",
4949
default_args=DEFAULT_ARGS,
5050
start_date=pendulum.datetime(2000, 1, 1),
5151
catchup=True,
@@ -71,14 +71,15 @@ def fetch_ds(locale, dt, uri, api_key):
7171
table_geocodes = set(map(int, chain(*cur.fetchall())))
7272

7373
to_ignore = ["2916104", "2919926", "2605459"]
74-
all_geocodes = set([
75-
int(adm.code)
76-
for adm
77-
in ADM2.filter(adm0=locale)
78-
if str(adm.code) not in to_ignore
79-
])
74+
all_geocodes = set(
75+
[
76+
int(adm.code)
77+
for adm in ADM2.filter(adm0=locale)
78+
if str(adm.code) not in to_ignore
79+
]
80+
)
8081
geocodes = all_geocodes.difference(table_geocodes)
81-
print(f"geocodes: {geocodes} ")
82+
print(f"geocodes [{len(geocodes)}]: {geocodes} ")
8283

8384
if not geocodes:
8485
return
@@ -91,7 +92,7 @@ def fetch_ds(locale, dt, uri, api_key):
9192
locale=locale,
9293
) as ds:
9394
for geocode in geocodes:
94-
adm = ADM2.get(code=geocode):
95+
adm = ADM2.get(code=geocode)
9596
with engine.connect() as conn:
9697
ds.cope.to_sql(adm, conn, tablename, "weather")
9798
file = Path(f"{basename}.zip")

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ENV PATH "$PATH:/usr/bin/dirname"
4949

5050
COPY --chown=airflow alertflow/airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
5151
COPY --chown=airflow docker/scripts/entrypoint.sh /entrypoint.sh
52-
COPY --chown=airflow pyproject.toml ${AIRFLOW_HOME}
52+
COPY --chown=airflow pyproject.toml README.md ${AIRFLOW_HOME}
5353
RUN chmod +x /entrypoint.sh
5454

5555
USER airflow

0 commit comments

Comments
 (0)