Skip to content

Commit

Permalink
chore(satellite): update satellite-weather-downloader dependency to 1…
Browse files Browse the repository at this point in the history
….9.6
  • Loading branch information
luabida committed May 18, 2024
1 parent 9f9a890 commit fe2db5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions alertflow/dags/satellite-weather/brasil.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
tags=["Brasil", "Copernicus"],
schedule="@daily",
default_args=DEFAULT_ARGS,
start_date=pendulum.datetime(2014, 1, 1),
start_date=pendulum.datetime(2024, 1, 1),
catchup=True,
max_active_runs=14,
):
Expand Down Expand Up @@ -90,10 +90,12 @@ def extract_transform_load(
max_update_delay = start_date - timedelta(days=6)

with create_engine(psql_uri["PSQL_MAIN_URI"]).connect() as conn:
cur = conn.execute(text(
"SELECT geocodigo FROM weather.copernicus_brasil"
f" WHERE date = '{str(max_update_delay.date())}'"
))
cur = conn.execute(
text(
"SELECT geocodigo FROM weather.copernicus_brasil"
f" WHERE date = '{str(max_update_delay.date())}'"
)
)
table_geocodes = set(chain(*cur.fetchall()))

all_geocodes = set([mun["geocodigo"] for mun in MUNICIPALITIES])
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ RUN source /home/airflow/mambaforge/bin/activate \
&& sed -i "s/include-system-site-packages = false/include-system-site-packages = true/" /opt/envs/py310/pyvenv.cfg \
&& source /opt/envs/py310/bin/activate \
&& pip install \
"satellite-weather-downloader >= 1.9.4" \
"satellite-weather-downloader >= 1.9.6" \
psycopg2

RUN echo "alias activate_episcanner='source /home/airflow/mambaforge/bin/activate episcanner-downloader'" >> /home/airflow/.bashrc
Expand Down

0 comments on commit fe2db5d

Please sign in to comment.