17
17
from .enums import enum_for_sa_enum
18
18
from .fields import (BatchSQLAlchemyConnectionField ,
19
19
default_connection_field_factory )
20
+ from .registry import get_global_registry
20
21
from .resolvers import get_attr_resolver , get_custom_resolver
21
- from .utils import (registry_sqlalchemy_model_from_str , safe_isinstance ,
22
- singledispatchbymatchfunction , value_equals , DummyImport )
22
+ from .utils import (DummyImport , registry_sqlalchemy_model_from_str ,
23
+ safe_isinstance , singledispatchbymatchfunction ,
24
+ value_equals )
23
25
24
26
try :
25
27
from typing import ForwardRef
@@ -248,7 +250,6 @@ def convert_column_to_float(type, column, registry=None):
248
250
249
251
@convert_sqlalchemy_type .register (sqa_types .Enum )
250
252
def convert_enum_to_enum (type , column , registry = None ):
251
- from .registry import get_global_registry
252
253
return lambda : enum_for_sa_enum (type , registry or get_global_registry ())
253
254
254
255
@@ -257,8 +258,6 @@ def convert_enum_to_enum(type, column, registry=None):
257
258
def convert_choice_to_enum (type , column , registry = None ):
258
259
name = "{}_{}" .format (column .table .name , column .key ).upper ()
259
260
if isinstance (type .type_impl , EnumTypeImpl ):
260
- print ("AAAA" )
261
- print (EnumTypeImpl )
262
261
# type.choices may be Enum/IntEnum, in ChoiceType both presented as EnumMeta
263
262
# do not use from_enum here because we can have more than one enum column in table
264
263
return graphene .Enum (name , list ((v .name , v .value ) for v in type .choices ))
@@ -302,7 +301,6 @@ def convert_variant_to_impl_type(type, column, registry=None):
302
301
303
302
@singledispatchbymatchfunction
304
303
def convert_sqlalchemy_hybrid_property_type (arg : Any ):
305
- from .registry import get_global_registry
306
304
existing_graphql_type = get_global_registry ().get_type_for_model (arg )
307
305
if existing_graphql_type :
308
306
return existing_graphql_type
0 commit comments