Skip to content

Commit

Permalink
Avoid param warning when passing reference to Child param (#7140)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Aug 13, 2024
1 parent c620eb6 commit 1ce03a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions panel/viewable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ def __init__(
):
...

def __init__(self, /, default=Undefined, class_=Viewable, **params):
def __init__(self, /, default=Undefined, class_=Viewable, allow_refs=False, **params):
if isinstance(class_, type) and not issubclass(class_, Viewable):
raise TypeError(
f"Child.class_ must be an instance of Viewable, not {type(class_)}."
Expand All @@ -1103,7 +1103,10 @@ def __init__(self, /, default=Undefined, class_=Viewable, **params):
raise TypeError(
f"Child.class_ must be an instance of Viewable, not {invalid}."
)
super().__init__(default=self._transform_value(default), class_=class_, **params)
super().__init__(
default=self._transform_value(default), class_=class_,
allow_refs=allow_refs, **params
)

def _transform_value(self, val):
if not isinstance(val, Viewable) and val not in (None, Undefined):
Expand Down

0 comments on commit 1ce03a2

Please sign in to comment.