You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by "mistercrunch (GitHub)" <gi...@apache.org> on 2018/08/25 22:15:40 UTC
[GitHub] [incubator-superset] mistercrunch opened pull request #5730:
[sql_json] allow not specifying client_id
We're opening the sql_json endpoint at Lyft to other apps leveraging
Superset as a data-access layer that enforces authentication and our data
access policy.
Currently sql_json requires the client to pass a `client_id` parameter
that uniquely identifies the query, that can then be used for polling
when in async mode. This PR makes it such that you don't have to define
a client_id anymore. It just gets generated when not passed.
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] mistercrunch closed pull request #5730:
[sql_json] allow not specifying client_id
Posted by "mistercrunch (GitHub)" <gi...@apache.org>.
[ pull request closed by mistercrunch ]
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] mistercrunch commented on pull request
#5730: [sql_json] allow not specifying client_id
Posted by "mistercrunch (GitHub)" <gi...@apache.org>.
Turns out it isn't necessary as far as I understand.
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #5730:
[sql_json] allow not specifying client_id
Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@cae0704`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `66.66%`.
[](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5730 +/- ##
=========================================
Coverage ? 63.38%
=========================================
Files ? 361
Lines ? 22998
Branches ? 2559
=========================================
Hits ? 14577
Misses ? 8406
Partials ? 15
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `73.95% <100%> (ø)` | |
| [superset/utils.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMucHk=) | `88.98% <50%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?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/5730?src=pr&el=footer). Last update [cae0704...862075f](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #5730:
[sql_json] allow not specifying client_id
Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@cae0704`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `66.66%`.
[](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5730 +/- ##
=========================================
Coverage ? 63.38%
=========================================
Files ? 361
Lines ? 22998
Branches ? 2559
=========================================
Hits ? 14577
Misses ? 8406
Partials ? 15
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `73.95% <100%> (ø)` | |
| [superset/utils.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMucHk=) | `88.98% <50%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?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/5730?src=pr&el=footer). Last update [cae0704...862075f](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #5730:
[sql_json] allow not specifying client_id
Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@cae0704`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `66.66%`.
[](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5730 +/- ##
=========================================
Coverage ? 63.38%
=========================================
Files ? 361
Lines ? 22998
Branches ? 2559
=========================================
Hits ? 14577
Misses ? 8406
Partials ? 15
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `73.95% <100%> (ø)` | |
| [superset/utils.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMucHk=) | `88.98% <50%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?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/5730?src=pr&el=footer). Last update [cae0704...862075f](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] betodealmeida commented on pull request
#5730: [sql_json] allow not specifying client_id
Posted by "betodealmeida (GitHub)" <gi...@apache.org>.
I know that right now `admin` has user id 1, but in the future it could change to be 0 and it would break this code. I think it's better to be more explicit here an unravel the one liner:
```python
client_id = request.form.get('client_id') or utils.shortid()
try:
user_id = int(g.user.get_id())
except Exception:
user_id = None
query = Query(
...
user_id=user_id,
client_id=client_id,
)
```
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] mistercrunch commented on pull request
#5730: [sql_json] allow not specifying client_id
Posted by "mistercrunch (GitHub)" <gi...@apache.org>.
I'm not even sure that the int casting is necessary here, let me check
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #5730:
[sql_json] allow not specifying client_id
Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@cae0704`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `66.66%`.
[](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5730 +/- ##
=========================================
Coverage ? 63.38%
=========================================
Files ? 361
Lines ? 22998
Branches ? 2559
=========================================
Hits ? 14577
Misses ? 8406
Partials ? 15
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `73.95% <100%> (ø)` | |
| [superset/utils.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMucHk=) | `88.98% <50%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?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/5730?src=pr&el=footer). Last update [cae0704...862075f](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] mistercrunch commented on pull request
#5730: [sql_json] allow not specifying client_id
Posted by "mistercrunch (GitHub)" <gi...@apache.org>.
What I'm fixing here is that `g.user.get_id()` returns `None` when using the token auth mechanism on our fork. int(None) raises.
I can change this to `g.user.get_id() is not None`
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #5730:
[sql_json] allow not specifying client_id
Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@cae0704`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `66.66%`.
[](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5730 +/- ##
=========================================
Coverage ? 63.38%
=========================================
Files ? 361
Lines ? 22998
Branches ? 2559
=========================================
Hits ? 14577
Misses ? 8406
Partials ? 15
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `73.95% <100%> (ø)` | |
| [superset/utils.py](https://codecov.io/gh/apache/incubator-superset/pull/5730/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMucHk=) | `88.98% <50%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/5730?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/5730?src=pr&el=footer). Last update [cae0704...862075f](https://codecov.io/gh/apache/incubator-superset/pull/5730?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org
[GitHub] [incubator-superset] betodealmeida commented on pull request
#5730: [sql_json] allow not specifying client_id
Posted by "betodealmeida (GitHub)" <gi...@apache.org>.
With the try block, `int(None)` would raise and `user_id` would be set to `None`.
[ Full content available at: https://github.com/apache/incubator-superset/pull/5730 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org