@@ -493,7 +493,7 @@ def migrate_settings(cls, settings_, version):
493493
494494 @classmethod
495495 def migrate_context (cls , context , version ):
496- if version < 2 :
496+ if version < 2 and hasattr ( context , "ordered_domain" ) :
497497 domain = context .ordered_domain
498498 c_domain = [t for t in context .ordered_domain if t [1 ] == 2 ]
499499 d_domain = [t for t in context .ordered_domain if t [1 ] == 1 ]
@@ -509,12 +509,18 @@ def migrate_context(cls, context, version):
509509 "attr_shape" : context .values ["attr_shape" ],
510510 "attr_size" : context .values ["attr_size" ]
511511 }
512- if version == 3 :
512+ if version < 4 :
513513 values = context .values
514- values ["attr_color" ] = values ["graph" ]["attr_color" ]
515- values ["attr_size" ] = values ["graph" ]["attr_size" ]
516- values ["attr_shape" ] = values ["graph" ]["attr_shape" ]
517- values ["attr_label" ] = values ["graph" ]["attr_label" ]
514+ if "graph" in values :
515+ graph = values ["graph" ]
516+ if "attr_color" in graph :
517+ values ["attr_color" ] = graph ["attr_color" ]
518+ if "attr_size" in graph :
519+ values ["attr_size" ] = graph ["attr_size" ]
520+ if "attr_shape" in graph :
521+ values ["attr_shape" ] = graph ["attr_shape" ]
522+ if "attr_label" in graph :
523+ values ["attr_label" ] = graph ["attr_label" ]
518524
519525
520526def column_data (table , var , dtype ):
0 commit comments