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 2022/11/19 09:22:29 UTC

[GitHub] [superset] john-bodley opened a new pull request, #22172: fix: SQL Lab QuerySource via referrer

john-bodley opened a new pull request, #22172:
URL: https://github.com/apache/superset/pull/22172

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   
   At Airbnb we've noticed in the logs (see attached) that the QuerySource is undefined which occurs the referrer is of the form `.../superset/sqllab` i.e., without the trailing `/`. 
   
   <img width="1429" alt="Screen Shot 2022-11-19 at 1 19 59 AM" src="https://user-images.githubusercontent.com/4567245/202844043-cc132d1b-242b-4846-8912-42eab0a24305.png">
   
   Grokking through the code there are a number of examples where the trailing `/` isn't provided, hence it seems prudent to relax the requirement that the trailing `/` is required to match queries originating from SQL Lab. 
   
   ```
   $ git grep "/sqllab?"
   docs/docs/installation/sql-templating.mdx:  coworker in Spain the following SQL Lab URL `www.example.com/superset/sqllab?countrycode=ES`
   docs/docs/installation/sql-templating.mdx:  and your coworker in the USA the following SQL Lab URL `www.example.com/superset/sqllab?countrycode=US`
   superset-frontend/src/SqlLab/components/QueryTable/index.tsx:  const url = `/superset/sqllab?queryId=${id}`;
   superset-frontend/src/views/CRUD/data/query/QueryList.tsx:            <a href={`/superset/sqllab?queryId=${id}`}>
   superset-frontend/src/views/CRUD/data/query/QueryList.tsx:            window.location.assign(`/superset/sqllab?queryId=${id}`)
   superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx:    window.open(`${window.location.origin}/superset/sqllab?new=true`);
   superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx:    window.open(`${window.location.origin}/superset/sqllab?savedQueryId=${id}`);
   superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx:          `${window.location.origin}/superset/sqllab?savedQueryId=${id}`,
   superset-frontend/src/views/CRUD/hooks.ts:      `${window.location.origin}/superset/sqllab?savedQueryId=${id}`,
   superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx:  if ('sql' in entity) return `/superset/sqllab?savedQueryId=${entity.id}`;
   superset-frontend/src/views/CRUD/welcome/EmptyState.tsx:    [WelcomeTable.SavedQueries]: '/superset/sqllab?new=true',
   superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx:            window.location.href = `/superset/sqllab?savedQueryId=${query.id}`;
   superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx:              window.location.href = '/superset/sqllab?new=true';
   superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx:                window.location.href = `/superset/sqllab?savedQueryId=${q.id}`;
   superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx:                url={`/superset/sqllab?savedQueryId=${q.id}`}
   superset-frontend/src/views/components/Menu.test.tsx:    url: '/superset/sqllab?new=true',
   superset-frontend/src/views/components/RightMenu.test.tsx:    url: '/superset/sqllab?new=true',
   superset-frontend/src/views/components/RightMenu.tsx:      url: '/superset/sqllab?new=true',
   superset/jinja_context.py:        `?foo=bar`, as in `{domain}/superset/sqllab?foo=bar`. Then if your query is
   superset/models/sql_lab.py:            <a href="/superset/sqllab?savedQueryId={self.id}">
   superset/models/sql_lab.py:        return "/superset/sqllab?savedQueryId={0}".format(self.id)
   ```
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   
   CI.
   
   ### 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: notifications-unsubscribe@superset.apache.org

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


[GitHub] [superset] john-bodley merged pull request #22172: fix: SQL Lab QuerySource via referrer

Posted by GitBox <gi...@apache.org>.
john-bodley merged PR #22172:
URL: https://github.com/apache/superset/pull/22172


-- 
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: notifications-unsubscribe@superset.apache.org

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


[GitHub] [superset] codecov[bot] commented on pull request #22172: fix: SQL Lab QuerySource via referrer

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #22172:
URL: https://github.com/apache/superset/pull/22172#issuecomment-1320843720

   # [Codecov](https://codecov.io/gh/apache/superset/pull/22172?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#22172](https://codecov.io/gh/apache/superset/pull/22172?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4439524) into [master](https://codecov.io/gh/apache/superset/commit/7e54b88a519e70aee7ef3add39f0fed1d6fa7272?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7e54b88) will **decrease** coverage by `11.39%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #22172       +/-   ##
   ===========================================
   - Coverage   67.00%   55.61%   -11.40%     
   ===========================================
     Files        1835     1835               
     Lines       69964    69964               
     Branches     7588     7588               
   ===========================================
   - Hits        46879    38908     -7971     
   - Misses      21119    29090     +7971     
     Partials     1966     1966               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.61% <0.00%> (ø)` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `57.57% <0.00%> (-23.83%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `50.90% <0.00%> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/22172?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `78.00% <0.00%> (-12.50%)` | :arrow_down: |
   | [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset/tags/core.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFncy9jb3JlLnB5) | `4.54% <0.00%> (-95.46%)` | :arrow_down: |
   | [superset/key\_value/commands/update.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `0.00% <0.00%> (-90.91%)` | :arrow_down: |
   | [superset/key\_value/commands/delete.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2RlbGV0ZS5weQ==) | `0.00% <0.00%> (-87.88%)` | :arrow_down: |
   | [superset/key\_value/commands/delete\_expired.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2RlbGV0ZV9leHBpcmVkLnB5) | `0.00% <0.00%> (-84.00%)` | :arrow_down: |
   | [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `15.62% <0.00%> (-76.25%)` | :arrow_down: |
   | [superset/datasets/commands/create.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvY3JlYXRlLnB5) | `30.61% <0.00%> (-69.39%)` | :arrow_down: |
   | [superset/datasets/commands/update.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvdXBkYXRlLnB5) | `25.00% <0.00%> (-69.05%)` | :arrow_down: |
   | [superset/datasets/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YXNldHMvY29tbWFuZHMvaW1wb3J0ZXJzL3YwLnB5) | `24.03% <0.00%> (-69.00%)` | :arrow_down: |
   | ... and [282 more](https://codecov.io/gh/apache/superset/pull/22172/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@superset.apache.org

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