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/02/20 06:43:38 UTC
[GitHub] [incubator-superset] john-bodley opened a new pull request #9173:
[fix] SQL query source
john-bodley opened a new pull request #9173: [fix] SQL query source
URL: https://github.com/apache/incubator-superset/pull/9173
### CATEGORY
Choose one
- [ ] Bug Fix
- [x] Enhancement (new features, refinement)
- [ ] Refactor
- [ ] Add tests
- [ ] Build / Development Environment
- [ ] Documentation
### SUMMARY
This PR makes a couple of updates to the encoding of the query source for SQL queries:
1. Uses an enum as opposed to a string to int dictionary mapping.
2. Moves the referrer logic (used for determining dashboard and chart queries) from `get_df` to `get_sqla_engine`.
The reason for the later was there were a number of places where `get_sqla_engine` were being called without a source and it felt that this would be a better place to add the fallback logic if the source wasn't explicitly defined.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TEST PLAN
CI and tested locally.
### 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
### REVIEWERS
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
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
#9173: [fix] SQL query source
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #9173: [fix] SQL query source
URL: https://github.com/apache/incubator-superset/pull/9173#discussion_r382145974
##########
File path: superset/utils/core.py
##########
@@ -1235,3 +1233,13 @@ class ReservedUrlParameters(Enum):
STANDALONE = "standalone"
EDIT_MODE = "edit"
+
+
+class QuerySource(Enum):
+ """
+ The source of the SQL query.
Review comment:
nit: `The source of a SQL query.` reads better i think
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] john-bodley commented on a change in pull
request #9173: [fix] SQL query source
Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #9173: [fix] SQL query source
URL: https://github.com/apache/incubator-superset/pull/9173#discussion_r381810132
##########
File path: superset/models/core.py
##########
@@ -314,6 +314,12 @@ def get_sqla_engine(
params.update(self.get_encrypted_extra())
if DB_CONNECTION_MUTATOR:
+ if not source and request and request.referrer:
Review comment:
This is similar logic to what was defined in `get_df` however it's been pushed further up the stack. Note we only try to mutate the source if it isn't explicitly defined.
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] john-bodley merged pull request #9173: [fix]
SQL query source
Posted by GitBox <gi...@apache.org>.
john-bodley merged pull request #9173: [fix] SQL query source
URL: https://github.com/apache/incubator-superset/pull/9173
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on issue #9173:
[fix] SQL query source
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #9173: [fix] SQL query source
URL: https://github.com/apache/incubator-superset/pull/9173#issuecomment-588645477
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=h1) Report
> Merging [#9173](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/c1750af54aa5088184abec09d4490b47d5dc4f8c?src=pr&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9173/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9173 +/- ##
==========================================
- Coverage 59.16% 59.13% -0.04%
==========================================
Files 372 372
Lines 11935 11938 +3
Branches 2927 2925 -2
==========================================
- Hits 7061 7059 -2
- Misses 4694 4699 +5
Partials 180 180
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ontend/src/components/ListView/TableCollection.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9173/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvVGFibGVDb2xsZWN0aW9uLnRzeA==) | `88.88% <0%> (-3.71%)` | :arrow_down: |
| [...frontend/src/views/dashboardList/DashboardList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9173/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2Rhc2hib2FyZExpc3QvRGFzaGJvYXJkTGlzdC50c3g=) | `69.72% <0%> (-3.43%)` | :arrow_down: |
| [...uperset-frontend/src/views/chartList/ChartList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9173/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2NoYXJ0TGlzdC9DaGFydExpc3QudHN4) | `74.48% <0%> (-0.26%)` | :arrow_down: |
| [...et-frontend/src/components/ConfirmStatusChange.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9173/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29uZmlybVN0YXR1c0NoYW5nZS50c3g=) | `100% <0%> (ø)` | :arrow_up: |
| [...rset-frontend/src/components/ListView/ListView.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9173/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvTGlzdFZpZXcudHN4) | `92.4% <0%> (+0.19%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9173?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/9173?src=pr&el=footer). Last update [c1750af...5a4cb9c](https://codecov.io/gh/apache/incubator-superset/pull/9173?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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #9173: [fix] SQL
query source
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9173: [fix] SQL query source
URL: https://github.com/apache/incubator-superset/pull/9173#issuecomment-588645477
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=h1) Report
> Merging [#9173](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/c1750af54aa5088184abec09d4490b47d5dc4f8c?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9173/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9173?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9173 +/- ##
=======================================
Coverage 59.16% 59.16%
=======================================
Files 372 372
Lines 11935 11935
Branches 2927 2927
=======================================
Hits 7061 7061
Misses 4694 4694
Partials 180 180
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9173?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/9173?src=pr&el=footer). Last update [c1750af...014506d](https://codecov.io/gh/apache/incubator-superset/pull/9173?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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org