File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -168,9 +168,13 @@ def __init_subclass__(
168168 if not value .internal :
169169 valid_fields [name ] = value
170170
171- if value .type == list [str ]:
171+ v_type = value .type
172+ if isinstance (v_type , str ):
173+ v_type = eval (v_type )
174+
175+ if v_type == list [str ]:
172176 split_columns .add (name )
173- elif value . type is bool :
177+ elif v_type is bool :
174178 bools .add (name )
175179
176180 cls .VALID_FIELDS = valid_fields
@@ -207,7 +211,12 @@ def create_table(cls, con):
207211 sql_field_list = []
208212
209213 for name , field in cls .VALID_FIELDS .items ():
210- field_type = TYPE_MAP [field .type ]
214+ t = field .type
215+ # __future__ annotations
216+ if isinstance (t , str ):
217+ t = eval (t )
218+
219+ field_type = TYPE_MAP [t ]
211220 if field .primary_key :
212221 constraint = " PRIMARY KEY"
213222 elif field .unique :
You can’t perform that action at this time.
0 commit comments