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/05/04 11:58:21 UTC
[GitHub] [incubator-superset] dpgaspar opened a new pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
dpgaspar opened a new pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724
### CATEGORY
Choose one
- [ ] Bug Fix
- [ ] Enhancement (new features, refinement)
- [ ] Refactor
- [ ] Add tests
- [ ] Build / Development Environment
- [ ] Documentation
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TEST PLAN
<!--- What steps should be taken to verify the changes -->
### 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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#discussion_r419550433
##########
File path: superset/charts/api.py
##########
@@ -509,20 +516,14 @@ def thumbnail(
FileWrapper(screenshot), mimetype="image/png", direct_passthrough=True
)
- def add_apispec_components(self, api_spec: APISpec) -> None:
- for chart_type in CHART_DATA_SCHEMAS:
- api_spec.components.schema(
- chart_type.__name__, schema=chart_type,
- )
- super().add_apispec_components(api_spec)
-
Review comment:
moved it to base, we can now set these kind of things using `openapi_spec_component_schemas` class attr.
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#discussion_r419550433
##########
File path: superset/charts/api.py
##########
@@ -509,20 +516,14 @@ def thumbnail(
FileWrapper(screenshot), mimetype="image/png", direct_passthrough=True
)
- def add_apispec_components(self, api_spec: APISpec) -> None:
- for chart_type in CHART_DATA_SCHEMAS:
- api_spec.components.schema(
- chart_type.__name__, schema=chart_type,
- )
- super().add_apispec_components(api_spec)
-
Review comment:
moved it to base, we can now add common schemas using `openapi_spec_component_schemas` class attr.
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#discussion_r419552769
##########
File path: superset/charts/schemas.py
##########
@@ -38,35 +95,74 @@ def validate_json(value: Union[bytes, bytearray, str]) -> None:
class ChartPostSchema(Schema):
- slice_name = fields.String(required=True, validate=Length(1, 250))
- description = fields.String(allow_none=True)
- viz_type = fields.String(allow_none=True, validate=Length(0, 250))
- owners = fields.List(fields.Integer())
- params = fields.String(allow_none=True, validate=validate_json)
- cache_timeout = fields.Integer(allow_none=True)
- datasource_id = fields.Integer(required=True)
- datasource_type = fields.String(required=True)
- datasource_name = fields.String(allow_none=True)
- dashboards = fields.List(fields.Integer())
+ """
+ Schema to add a new chart.
+ """
+
+ slice_name = fields.String(
+ description=slice_name_description, required=True, validate=Length(1, 250)
+ )
+ description = fields.String(description=description_description, allow_none=True)
Review comment:
There are some slight differences, my understanding is that `required`, requires that a field is present, but the field can be present but the value is `null` for example.
So on the above example, `description` may be present on the payload or not, and if present it can be `null`
----------------------------------------------------------------
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-io commented on pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#issuecomment-623423533
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9724?src=pr&el=h1) Report
> Merging [#9724](https://codecov.io/gh/apache/incubator-superset/pull/9724?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/5d167afb9499d7ce30c7ea763b19993af347dc23&el=desc) will **decrease** coverage by `11.81%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9724/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9724?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9724 +/- ##
===========================================
- Coverage 70.72% 58.90% -11.82%
===========================================
Files 584 402 -182
Lines 30382 12564 -17818
Branches 3112 3112
===========================================
- Hits 21487 7401 -14086
+ Misses 8781 4979 -3802
- Partials 114 184 +70
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `?` | |
| #javascript | `58.90% <ø> (ø)` | |
| #python | `?` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9724?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset-frontend/src/SqlLab/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvaW5kZXguanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/dashboard/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9pbmRleC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/setup/setupFormatters.js](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRm9ybWF0dGVycy5qcw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [311 more](https://codecov.io/gh/apache/incubator-superset/pull/9724/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9724?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/9724?src=pr&el=footer). Last update [5d167af...836119a](https://codecov.io/gh/apache/incubator-superset/pull/9724?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] villebro commented on a change in pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#discussion_r419538882
##########
File path: superset/charts/api.py
##########
@@ -509,20 +516,14 @@ def thumbnail(
FileWrapper(screenshot), mimetype="image/png", direct_passthrough=True
)
- def add_apispec_components(self, api_spec: APISpec) -> None:
- for chart_type in CHART_DATA_SCHEMAS:
- api_spec.components.schema(
- chart_type.__name__, schema=chart_type,
- )
- super().add_apispec_components(api_spec)
-
Review comment:
Are these now populated automatically?
##########
File path: superset/charts/schemas.py
##########
@@ -38,35 +95,74 @@ def validate_json(value: Union[bytes, bytearray, str]) -> None:
class ChartPostSchema(Schema):
- slice_name = fields.String(required=True, validate=Length(1, 250))
- description = fields.String(allow_none=True)
- viz_type = fields.String(allow_none=True, validate=Length(0, 250))
- owners = fields.List(fields.Integer())
- params = fields.String(allow_none=True, validate=validate_json)
- cache_timeout = fields.Integer(allow_none=True)
- datasource_id = fields.Integer(required=True)
- datasource_type = fields.String(required=True)
- datasource_name = fields.String(allow_none=True)
- dashboards = fields.List(fields.Integer())
+ """
+ Schema to add a new chart.
+ """
+
+ slice_name = fields.String(
+ description=slice_name_description, required=True, validate=Length(1, 250)
+ )
+ description = fields.String(description=description_description, allow_none=True)
Review comment:
I tried googling when to use `required` and when to use `allow_none`, but wasn't really able to find anything conclusive. Has this come up previously? I just used `required` everywhere, but now I'm not so sure anymore..
----------------------------------------------------------------
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] dpgaspar commented on pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#issuecomment-624062730
Thks @villebro!
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#discussion_r419552769
##########
File path: superset/charts/schemas.py
##########
@@ -38,35 +95,74 @@ def validate_json(value: Union[bytes, bytearray, str]) -> None:
class ChartPostSchema(Schema):
- slice_name = fields.String(required=True, validate=Length(1, 250))
- description = fields.String(allow_none=True)
- viz_type = fields.String(allow_none=True, validate=Length(0, 250))
- owners = fields.List(fields.Integer())
- params = fields.String(allow_none=True, validate=validate_json)
- cache_timeout = fields.Integer(allow_none=True)
- datasource_id = fields.Integer(required=True)
- datasource_type = fields.String(required=True)
- datasource_name = fields.String(allow_none=True)
- dashboards = fields.List(fields.Integer())
+ """
+ Schema to add a new chart.
+ """
+
+ slice_name = fields.String(
+ description=slice_name_description, required=True, validate=Length(1, 250)
+ )
+ description = fields.String(description=description_description, allow_none=True)
Review comment:
There are some slight differences, my understanding is that `required`, requires that a field is present, but the field can be present but the value is `null` for example
----------------------------------------------------------------
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