mirror of https://github.com/apache/superset.git
fix(timepicker): make pyparsing thread safe (#12489)
* fix: make pyparsing thread safe * remove parenthesis for decorator
This commit is contained in:
parent
40a334aacf
commit
b22e458108
|
@ -32,6 +32,7 @@ from pyparsing import (
|
||||||
Group,
|
Group,
|
||||||
Optional as ppOptional,
|
Optional as ppOptional,
|
||||||
ParseException,
|
ParseException,
|
||||||
|
ParserElement,
|
||||||
ParseResults,
|
ParseResults,
|
||||||
pyparsing_common,
|
pyparsing_common,
|
||||||
quotedString,
|
quotedString,
|
||||||
|
@ -40,6 +41,8 @@ from pyparsing import (
|
||||||
|
|
||||||
from .core import memoized
|
from .core import memoized
|
||||||
|
|
||||||
|
ParserElement.enablePackrat()
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -375,7 +378,7 @@ class EvalHolidayFunc: # pylint: disable=too-few-public-methods
|
||||||
raise ValueError(_("Unable to find such a holiday: [{}]").format(holiday))
|
raise ValueError(_("Unable to find such a holiday: [{}]").format(holiday))
|
||||||
|
|
||||||
|
|
||||||
@memoized()
|
@memoized
|
||||||
def datetime_parser() -> ParseResults: # pylint: disable=too-many-locals
|
def datetime_parser() -> ParseResults: # pylint: disable=too-many-locals
|
||||||
( # pylint: disable=invalid-name
|
( # pylint: disable=invalid-name
|
||||||
DATETIME,
|
DATETIME,
|
||||||
|
|
Loading…
Reference in New Issue