You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/13 11:01:44 UTC

[GitHub] [superset] ktmud commented on pull request #12489: fix(timepicker): make pyparsing thread safe

ktmud commented on pull request #12489:
URL: https://github.com/apache/superset/pull/12489#issuecomment-759374475


   I think I may have found another fix:
   
   ```diff
   diff --git a/superset/utils/date_parser.py b/superset/utils/date_parser.py
   index aee2c83a0..513c740ab 100644
   --- a/superset/utils/date_parser.py
   +++ b/superset/utils/date_parser.py
   @@ -33,6 +33,7 @@ from pyparsing import (
        Optional as ppOptional,
        ParseException,
        ParseResults,
   +    ParserElement,
        pyparsing_common,
        quotedString,
        Suppress,
   @@ -40,6 +41,8 @@ from pyparsing import (
    
    from .core import memoized
    
   +ParserElement.enablePackrat()
   +
    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))
    
    
   -@memoized()
   +@memoized
    def datetime_parser() -> ParseResults:  # pylint: disable=too-many-locals
        (  # pylint: disable=invalid-name
            DATETIME,
   ```
   
   Could you test this diff and see if it fixes things for you?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org