From 3b580deaac72cc5ece1a33959edddfab386e513a Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Wed, 18 Dec 2024 13:21:02 +0100 Subject: [PATCH] Handle (de)serialize None values in Panel View --- lumen/views/base.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lumen/views/base.py b/lumen/views/base.py index 875a1969..7e0bf700 100644 --- a/lumen/views/base.py +++ b/lumen/views/base.py @@ -615,7 +615,9 @@ def from_spec( @classmethod def _resolve_object(cls, spec, objects=None, unresolved=None, depth=0): - if not isinstance(spec, dict) or 'type' not in spec: + if spec is None: + return None + elif not isinstance(spec, dict) or 'type' not in spec: return spec elif spec['type'] in ('rx', 'param'): try: @@ -666,7 +668,9 @@ def _resolve_object(cls, spec, objects=None, unresolved=None, depth=0): def _serialize_object(self, obj, objects=None, refs=None, depth=0): obj_type = type(obj) - if objects is None: + if obj is None: + return None + elif objects is None: objects = {'pipeline': self.pipeline, obj.name: obj} else: objects[obj.name] = obj