Skip to content

Commit 09423fb

Browse files
Lifted pin on sqlalchemy in order to be able to use v2+ (geopython#1832)
1 parent e4beaf7 commit 09423fb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jobs:
9494
pip3 install -r requirements-manager.txt
9595
pip3 install -r requirements-django.txt
9696
python3 setup.py install
97-
pip3 install --upgrade "sqlalchemy<2"
9897
pip3 install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
9998
#pip3 install --upgrade rasterio==1.1.8
10099
- name: setup test data ⚙️

pygeoapi/provider/postgresql.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
import shapely
6363
from sqlalchemy import create_engine, MetaData, PrimaryKeyConstraint, asc, desc
6464
from sqlalchemy.engine import URL
65-
from sqlalchemy.exc import InvalidRequestError, OperationalError
65+
from sqlalchemy.exc import ConstraintColumnNotFoundError, \
66+
InvalidRequestError, OperationalError
6667
from sqlalchemy.ext.automap import automap_base
6768
from sqlalchemy.orm import Session, load_only
6869
from sqlalchemy.sql.expression import and_
@@ -515,7 +516,7 @@ def get_table_model(
515516
sqlalchemy_table_def = metadata.tables[f'{schema}.{table_name}']
516517
try:
517518
sqlalchemy_table_def.append_constraint(PrimaryKeyConstraint(id_field))
518-
except KeyError:
519+
except (ConstraintColumnNotFoundError, KeyError):
519520
raise ProviderQueryError(
520521
f"No such id_field column ({id_field}) on {schema}.{table_name}.")
521522

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ PyYAML
1414
rasterio
1515
requests
1616
shapely
17-
SQLAlchemy<2.0.0
17+
SQLAlchemy
1818
tinydb

0 commit comments

Comments
 (0)