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 2020/07/05 05:21:16 UTC
[GitHub] [incubator-superset] etr2460 opened a new pull request #10243: feat: support new errors payload in SQL Lab
etr2460 opened a new pull request #10243:
URL: https://github.com/apache/incubator-superset/pull/10243
### SUMMARY
Some query requests (namely security manager failures) already return errors in the new format, so we need to make sure the frontend can handle the new payload.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Custom error renderer:
<img width="1587" alt="Screen Shot 2020-07-04 at 9 34 42 PM" src="https://user-images.githubusercontent.com/7409244/86526050-e1e21d80-be43-11ea-8399-c31afca92678.png">
Successful query:
<img width="1600" alt="Screen Shot 2020-07-04 at 9 40 16 PM" src="https://user-images.githubusercontent.com/7409244/86526051-e3134a80-be43-11ea-93b9-83917a57018c.png">
Old error format:
<img width="1593" alt="Screen Shot 2020-07-04 at 9 40 36 PM" src="https://user-images.githubusercontent.com/7409244/86526052-e4447780-be43-11ea-9a52-c1f429473856.png">
### TEST PLAN
Unit tests, CI
- Ensure that security manager errors render with a custom error renderer
- Ensure successful queries render properly
- Ensure error payloads of the old format still render properly
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Requires DB Migration.
- [ ] Confirm DB Migration upgrade and downgrade tested.
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
to: @rusackas @graceguo-supercat @ktmud
----------------------------------------------------------------
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
[GitHub] [incubator-superset] etr2460 merged pull request #10243: feat: support new errors payload in SQL Lab
Posted by GitBox <gi...@apache.org>.
etr2460 merged pull request #10243:
URL: https://github.com/apache/incubator-superset/pull/10243
----------------------------------------------------------------
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
[GitHub] [incubator-superset] etr2460 commented on a change in pull request #10243: feat: support new errors payload in SQL Lab
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #10243:
URL: https://github.com/apache/incubator-superset/pull/10243#discussion_r450328623
##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -214,17 +215,25 @@ export default class ResultSet extends React.PureComponent<
if (query.state === 'stopped') {
return <Alert bsStyle="warning">Query was stopped</Alert>;
} else if (query.state === 'failed') {
- return (
- <Alert bsStyle="danger">
- {query.errorMessage}
- {query.link && (
- <a href={query.link} target="_blank" rel="noopener noreferrer">
- {' '}
- {t('(Request Access)')}{' '}
- </a>
- )}
- </Alert>
- );
+ if (query.errors) {
+ return (
+ <>
+ {query.errors.map(error => (
+ <ErrorMessageWithStackTrace
+ error={error}
+ message={error.message}
+ />
+ ))}
+ </>
Review comment:
Currently it never happens, so i'll default to using `query.errors[0]`. in the future we may have more than 1 error here, but we'll always render the first one for now then
----------------------------------------------------------------
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
[GitHub] [incubator-superset] codecov-commenter edited a comment on pull request #10243: feat: support new errors payload in SQL Lab
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #10243:
URL: https://github.com/apache/incubator-superset/pull/10243#issuecomment-653844534
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=h1) Report
> Merging [#10243](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/4281ad5486f976107b3fb3637519defe63133b9b&el=desc) will **decrease** coverage by `0.11%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10243/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #10243 +/- ##
==========================================
- Coverage 65.70% 65.58% -0.12%
==========================================
Files 594 594
Lines 31501 31607 +106
Branches 3221 3221
==========================================
+ Hits 20697 20730 +33
- Misses 10623 10696 +73
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.48% <100.00%> (+0.03%)` | :arrow_up: |
| #python | `69.91% <ø> (-0.25%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `35.68% <ø> (ø)` | |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `59.61% <100.00%> (ø)` | |
| [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `76.69% <100.00%> (+3.61%)` | :arrow_up: |
| [superset/views/database/views.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.35% <0.00%> (-28.24%)` | :arrow_down: |
| [superset/views/database/forms.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvZm9ybXMucHk=) | `78.37% <0.00%> (-12.32%)` | :arrow_down: |
| [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `83.98% <0.00%> (-2.78%)` | :arrow_down: |
| [...set-frontend/src/views/datasetList/DatasetList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2RhdGFzZXRMaXN0L0RhdGFzZXRMaXN0LnRzeA==) | `68.25% <0.00%> (-0.80%)` | :arrow_down: |
| [superset/app.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYXBwLnB5) | `81.52% <0.00%> (-0.30%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `90.64% <0.00%> (-0.18%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `57.37% <0.00%> (-0.11%)` | :arrow_down: |
| ... and [6 more](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=footer). Last update [4281ad5...89d73b9](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [incubator-superset] codecov-commenter commented on pull request #10243: feat: support new errors payload in SQL Lab
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #10243:
URL: https://github.com/apache/incubator-superset/pull/10243#issuecomment-653844534
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=h1) Report
> Merging [#10243](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/4281ad5486f976107b3fb3637519defe63133b9b&el=desc) will **decrease** coverage by `0.10%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/10243/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #10243 +/- ##
==========================================
- Coverage 65.70% 65.59% -0.11%
==========================================
Files 594 594
Lines 31501 31598 +97
Branches 3221 3221
==========================================
+ Hits 20697 20727 +30
- Misses 10623 10690 +67
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.48% <100.00%> (+0.03%)` | :arrow_up: |
| #python | `69.93% <ø> (-0.23%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `35.68% <ø> (ø)` | |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `59.61% <100.00%> (ø)` | |
| [...erset-frontend/src/SqlLab/components/ResultSet.tsx](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC50c3g=) | `76.69% <100.00%> (+3.61%)` | :arrow_up: |
| [superset/views/database/views.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.35% <0.00%> (-28.24%)` | :arrow_down: |
| [superset/views/database/forms.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvZm9ybXMucHk=) | `78.37% <0.00%> (-12.32%)` | :arrow_down: |
| [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `83.98% <0.00%> (-2.78%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.36% <0.00%> (-2.64%)` | :arrow_down: |
| [...set-frontend/src/views/datasetList/DatasetList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2RhdGFzZXRMaXN0L0RhdGFzZXRMaXN0LnRzeA==) | `68.25% <0.00%> (-0.80%)` | :arrow_down: |
| [superset/app.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYXBwLnB5) | `81.52% <0.00%> (-0.30%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `90.64% <0.00%> (-0.18%)` | :arrow_down: |
| ... and [9 more](https://codecov.io/gh/apache/incubator-superset/pull/10243/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=footer). Last update [4281ad5...89d73b9](https://codecov.io/gh/apache/incubator-superset/pull/10243?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [incubator-superset] ktmud commented on a change in pull request #10243: feat: support new errors payload in SQL Lab
Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #10243:
URL: https://github.com/apache/incubator-superset/pull/10243#discussion_r449850554
##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -214,17 +215,25 @@ export default class ResultSet extends React.PureComponent<
if (query.state === 'stopped') {
return <Alert bsStyle="warning">Query was stopped</Alert>;
} else if (query.state === 'failed') {
- return (
- <Alert bsStyle="danger">
- {query.errorMessage}
- {query.link && (
- <a href={query.link} target="_blank" rel="noopener noreferrer">
- {' '}
- {t('(Request Access)')}{' '}
- </a>
- )}
- </Alert>
- );
+ if (query.errors) {
+ return (
+ <>
+ {query.errors.map(error => (
+ <ErrorMessageWithStackTrace
+ error={error}
+ message={error.message}
+ />
+ ))}
+ </>
Review comment:
So it seems we may render multiple error messages? Have you tested what the UI look like with multiple alert boxes stacked on top of each other? If it never happens, maybe use `query.errors[0]`?
On a separate note, I'm making an API generator that [also handles server side errors](https://github.com/apache-superset/superset-ui/pull/666/files#diff-886b8347540bd209fe65965510de85f8), hopefully it'd be useful to simplify error rendering as well.
----------------------------------------------------------------
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