ktmud opened a new pull request, #20799: URL: https://github.com/apache/superset/pull/20799
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY Enable tracking URL for Presto and Trino (previously it is only available for Hive queries) and also change `TRACKING_URL_TRANSFORMER` to run at runtime (as opposed to when queries are fetched) so that we can display different tracking URL based on query age (most tracking URLs will expire after a certain amount of time---in Trino/Preso, this is configured by [`query.min-expire-age`](https://trino.io/docs/current/admin/properties-query-management.html#query-min-expire-age). Had to update query execution logics to add end time for failed executions, too. While debugging, I also realized the TIMED_OUT status isn't actually in use---and now the frontend also cannot handle that status. We should probably add it back, but let's save it for another PR. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF When queries are still running: <img width="746" alt="image" src="https://user-images.githubusercontent.com/335541/180104968-4bf67e62-5b7f-4105-bebb-a1f5d6f8ccc5.png"> We will now display the tracking url even for failed jobs, this is useful for users to debug their failed queries: <img width="837" alt="Xnip2022-07-20_14-46-55" src="https://user-images.githubusercontent.com/335541/180104883-b13f72b4-4a88-443d-aa15-cf39edf7715f.png"> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Connect to a Presto or Trino dataset and run some long-running or erroneous queries 2. Optionally, update Superset config to test customize `TRACKING_URL_TRANSFORMER`. For example, following setting will only display tracking urls for queries finished within the last 5 minutes: ```python def TRACKING_URL_TRANSFORMER(url: str, query: "Query") -> Optional[str]: if not query.end_time or ( now_as_float() - float(query.end_time) < timedelta(minutes=5).total_seconds() * 1000 ): return re.sub( r"^https?://([^/]+)/", "https://trino.datalake.example.org/", url ) return None ``` ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
