Skip to content

Commit

Permalink
feat: SQLAlchemy v2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Sep 7, 2024
1 parent 8a00a2b commit 9fb7aa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
1 change: 0 additions & 1 deletion ckanext/spatial/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from pprint import pprint

from ckan import model
from ckan.model.package_extra import PackageExtra

try:
from ckanext.spatial.lib.reports import validation_report
Expand Down

0 comments on commit 9fb7aa1

Please sign in to comment.