From dcc1072f28e06305201627fd5cf919847d0baebb Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Wed, 9 Jun 2021 11:10:18 -0400 Subject: [PATCH] allow / pattern in bars --- packages/python/plotly/_plotly_utils/basevalidators.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/python/plotly/_plotly_utils/basevalidators.py b/packages/python/plotly/_plotly_utils/basevalidators.py index 1dc3ea48677..da0d21db7c4 100644 --- a/packages/python/plotly/_plotly_utils/basevalidators.py +++ b/packages/python/plotly/_plotly_utils/basevalidators.py @@ -458,7 +458,13 @@ def __init__( # ---------------------------- # Look for regular expressions for v in self.values: - if v and isinstance(v, string_types) and v[0] == "/" and v[-1] == "/": + if ( + v + and isinstance(v, string_types) + and v[0] == "/" + and v[-1] == "/" + and len(v) > 1 + ): # String is a regex with leading and trailing '/' character regex_str = v[1:-1] self.val_regexs.append(re.compile(regex_str))