Skip to content

Commit

Permalink
fix(timepicker): make pyparsing thread safe (#12489)
Browse files Browse the repository at this point in the history
* fix: make pyparsing thread safe

* remove parenthesis for decorator
  • Loading branch information
zhaoyongjie authored and villebro committed Jan 13, 2021
1 parent b213c1c commit 4f35234
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion superset/utils/date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
Group,
Optional as ppOptional,
ParseException,
ParserElement,
ParseResults,
pyparsing_common,
quotedString,
Expand All @@ -40,6 +41,8 @@

from .core import memoized

ParserElement.enablePackrat()

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -375,7 +378,7 @@ def eval(self) -> datetime:
raise ValueError(_("Unable to find such a holiday: [{}]").format(holiday))


@memoized()
@memoized
def datetime_parser() -> ParseResults: # pylint: disable=too-many-locals
( # pylint: disable=invalid-name
DATETIME,
Expand Down

0 comments on commit 4f35234

Please sign in to comment.