@@ -116,22 +116,25 @@ def convert_column_to_datetime(type, column, registry=None):
116
116
@convert_sqlalchemy_type .register (types .Integer )
117
117
def convert_column_to_int_or_id (type , column , registry = None ):
118
118
if column .primary_key :
119
- return ID (description = get_column_doc (column ), required = not (is_column_nullable (column )))
119
+ return ID (description = get_column_doc (column ),
120
+ required = not (is_column_nullable (column )))
120
121
else :
121
122
return Int (description = get_column_doc (column ),
122
123
required = not (is_column_nullable (column )))
123
124
124
125
125
126
@convert_sqlalchemy_type .register (types .Boolean )
126
127
def convert_column_to_boolean (type , column , registry = None ):
127
- return Boolean (description = get_column_doc (column ), required = not (is_column_nullable (column )))
128
+ return Boolean (description = get_column_doc (column ),
129
+ required = not (is_column_nullable (column )))
128
130
129
131
130
132
@convert_sqlalchemy_type .register (types .Float )
131
133
@convert_sqlalchemy_type .register (types .Numeric )
132
134
@convert_sqlalchemy_type .register (types .BigInteger )
133
135
def convert_column_to_float (type , column , registry = None ):
134
- return Float (description = get_column_doc (column ), required = not (is_column_nullable (column )))
136
+ return Float (description = get_column_doc (column ),
137
+ required = not (is_column_nullable (column )))
135
138
136
139
137
140
@convert_sqlalchemy_type .register (types .Enum )
@@ -141,7 +144,8 @@ def convert_enum_to_enum(type, column, registry=None):
141
144
except AttributeError :
142
145
items = zip (type .enums , type .enums )
143
146
return Field (Enum (type .name , items ),
144
- description = get_column_doc (column ), required = not (is_column_nullable (column )))
147
+ description = get_column_doc (column ),
148
+ required = not (is_column_nullable (column )))
145
149
146
150
147
151
@convert_sqlalchemy_type .register (ChoiceType )
@@ -159,16 +163,19 @@ def convert_scalar_list_to_list(type, column, registry=None):
159
163
def convert_postgres_array_to_list (_type , column , registry = None ):
160
164
graphene_type = convert_sqlalchemy_type (column .type .item_type , column )
161
165
inner_type = type (graphene_type )
162
- return List (inner_type , description = get_column_doc (column ), required = not (is_column_nullable (column )))
166
+ return List (inner_type , description = get_column_doc (column ),
167
+ required = not (is_column_nullable (column )))
163
168
164
169
165
170
@convert_sqlalchemy_type .register (postgresql .HSTORE )
166
171
@convert_sqlalchemy_type .register (postgresql .JSON )
167
172
@convert_sqlalchemy_type .register (postgresql .JSONB )
168
173
def convert_json_to_string (type , column , registry = None ):
169
- return JSONString (description = get_column_doc (column ), required = not (is_column_nullable (column )))
174
+ return JSONString (description = get_column_doc (column ),
175
+ required = not (is_column_nullable (column )))
170
176
171
177
172
178
@convert_sqlalchemy_type .register (JSONType )
173
179
def convert_json_type_to_string (type , column , registry = None ):
174
- return JSONString (description = get_column_doc (column ), required = not (is_column_nullable (column )))
180
+ return JSONString (description = get_column_doc (column ),
181
+ required = not (is_column_nullable (column )))
0 commit comments