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


   I don't think the migration is particularly risky. You can pre-select the 
list of charts that use the invalid format of date string and update them one 
by one (for Airbnb, it's only a couple of hundreds such charts among about 16 
million).
   
   The query is as simple as a list of RegExp matches:
   
   ```sql
   SELECT
     id,
     params
   FROM "slices"
   WHERE regexp_like(params, '"time_range": "\d+ 
(days|weeks|months|years|quarters)')
      AND not regexp_like(params, '"time_range": "\d+.*(ago|before).*:')
   ```
   
   For MySQL and SQLite, you can use `.op('regexp')(...)`, for PostgreSQL, you 
can use `.op('similar to')(...)`.


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to