File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -50,18 +50,12 @@ def __call__(self, obj):
5050
5151class  E2BJSONFormatter (JSONFormatter ):
5252    def  __call__ (self , obj ):
53-         # Figure object is for some reason removed on execution of the cell, 
54-         # so it can't be used in type_printers or with top-level import 
55- 
56-         if  isinstance (obj , dict ):
57-             return  orjson .loads (orjson .dumps (obj , option = orjson .OPT_SERIALIZE_NUMPY )), {
58-                 "expanded" : True 
59-             }
60- 
61-         if  isinstance (obj , list ):
62-             return  orjson .loads (orjson .dumps (obj , option = orjson .OPT_SERIALIZE_NUMPY )), {
63-                 "expanded" : True 
64-             }
53+         if  isinstance (obj , (list , dict )):
54+             return  orjson .loads (
55+                 orjson .dumps (
56+                     obj , option = orjson .OPT_SERIALIZE_NUMPY  |  orjson .OPT_NON_STR_KEYS 
57+                 )
58+             ), {"expanded" : True }
6559
6660        return  super ().__call__ (obj )
6761
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments