Skip to content

Commit

Permalink
Merge pull request #338 from ckan/sqlalchemy2
Browse files Browse the repository at this point in the history
SQLAlchemy v2 support
  • Loading branch information
amercader authored Nov 7, 2024
2 parents 353ce23 + fe84d61 commit 1f2b9b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckanext/spatial/harvesters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from owslib import wms
import requests
import sqlalchemy as sa
from lxml import etree

from ckan import plugins as p
Expand Down Expand Up @@ -667,7 +668,9 @@ def import_stage(self, harvest_object):
# Defer constraints and flush so the dataset can be indexed with
# the harvest object id (on the after_show hook from the harvester
# plugin)
model.Session.execute('SET CONSTRAINTS harvest_object_package_id_fkey DEFERRED')
model.Session.execute(
sa.text('SET CONSTRAINTS harvest_object_package_id_fkey DEFERRED')
)
model.Session.flush()

try:
Expand Down

0 comments on commit 1f2b9b1

Please sign in to comment.