Skip to content

Commit 9f9a890

Browse files
authored
fix(brasil): fix 'Connection object has no attribute cursor' error (#31)
* fix(brasil): fix 'Connection object has no attribute cursor' error * Update satellite and fix sql execute
1 parent a989204 commit 9f9a890

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
cancel-in-progress: true
3737

3838
steps:
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4040

4141
- uses: actions/setup-node@v3
4242
with:
@@ -65,7 +65,7 @@ jobs:
6565
convention-name: conventionalcommits
6666

6767
- name: Install Conda Dependencies
68-
uses: conda-incubator/setup-miniconda@v2
68+
uses: conda-incubator/setup-miniconda@v3
6969
with:
7070
miniconda-version: "latest"
7171
mamba-version: "*"

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
shell: bash -l {0}
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
2424
submodules: recursive

alertflow/dags/satellite-weather/brasil.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ def extract_transform_load(
8484
from satellite import downloader as sat_d
8585
from satellite import weather as sat_w
8686
from satellite.weather.brazil.extract_latlons import MUNICIPALITIES
87-
from sqlalchemy import create_engine
87+
from sqlalchemy import create_engine, text
8888

8989
start_date = parser.parse(str(date))
9090
max_update_delay = start_date - timedelta(days=6)
9191

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

9999
all_geocodes = set([mun["geocodigo"] for mun in MUNICIPALITIES])

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ RUN source /home/airflow/mambaforge/bin/activate \
7979
&& sed -i "s/include-system-site-packages = false/include-system-site-packages = true/" /opt/envs/py310/pyvenv.cfg \
8080
&& source /opt/envs/py310/bin/activate \
8181
&& pip install \
82-
"satellite-weather-downloader >= 1.9.3" \
82+
"satellite-weather-downloader >= 1.9.4" \
8383
psycopg2
8484

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

0 commit comments

Comments
 (0)