Skip to content

Commit

Permalink
Lifted pin on sqlalchemy in order to be able to use v2+ (#1832)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogsilva authored Nov 7, 2024
1 parent e4beaf7 commit 09423fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ jobs:
pip3 install -r requirements-manager.txt
pip3 install -r requirements-django.txt
python3 setup.py install
pip3 install --upgrade "sqlalchemy<2"
pip3 install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
#pip3 install --upgrade rasterio==1.1.8
- name: setup test data ⚙️
Expand Down
5 changes: 3 additions & 2 deletions pygeoapi/provider/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
import shapely
from sqlalchemy import create_engine, MetaData, PrimaryKeyConstraint, asc, desc
from sqlalchemy.engine import URL
from sqlalchemy.exc import InvalidRequestError, OperationalError
from sqlalchemy.exc import ConstraintColumnNotFoundError, \
InvalidRequestError, OperationalError
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session, load_only
from sqlalchemy.sql.expression import and_
Expand Down Expand Up @@ -515,7 +516,7 @@ def get_table_model(
sqlalchemy_table_def = metadata.tables[f'{schema}.{table_name}']
try:
sqlalchemy_table_def.append_constraint(PrimaryKeyConstraint(id_field))
except KeyError:
except (ConstraintColumnNotFoundError, KeyError):
raise ProviderQueryError(
f"No such id_field column ({id_field}) on {schema}.{table_name}.")

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ PyYAML
rasterio
requests
shapely
SQLAlchemy<2.0.0
SQLAlchemy
tinydb

0 comments on commit 09423fb

Please sign in to comment.