File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 5
5
from typing import Any
6
6
7
7
from pyhocon import ConfigFactory , ConfigTree
8
- from sqlalchemy import create_engine
8
+ from sqlalchemy import create_engine , text
9
9
10
10
from databuilder import Scoped
11
11
from databuilder .extractor .base_extractor import Extractor
@@ -62,7 +62,11 @@ def _execute_query(self) -> None:
62
62
Create an iterator to execute sql.
63
63
"""
64
64
if not hasattr (self , 'results' ):
65
- self .results = self .connection .execute (self .extract_sql )
65
+ results = self .connection .execute (text (self .extract_sql ))
66
+ # Makes this forward compatible with sqlalchemy >= 1.4
67
+ if hasattr (results , "mappings" ):
68
+ results = results .mappings ()
69
+ self .results = results
66
70
67
71
if hasattr (self , 'model_class' ):
68
72
results = [self .model_class (** result )
Original file line number Diff line number Diff line change 5
5
6
6
from setuptools import find_packages , setup
7
7
8
- __version__ = '7.4.5 '
8
+ __version__ = '7.4.6 '
9
9
10
10
requirements_path = os .path .join (os .path .dirname (os .path .realpath (__file__ )),
11
11
'requirements.txt' )
You can’t perform that action at this time.
0 commit comments