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/01/09 14:28:44 UTC
[GitHub] [incubator-superset] dpgaspar opened a new pull request #8941:
Feature/dashboards export api
dpgaspar opened a new pull request #8941: Feature/dashboards export api
URL: https://github.com/apache/incubator-superset/pull/8941
### 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
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 #8941:
[dashboards] feat: export api
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8941: [dashboards] feat: export api
URL: https://github.com/apache/incubator-superset/pull/8941#issuecomment-572606149
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=h1) Report
> Merging [#8941](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/2d456e88ebf1ef6fe4da7bdca1e25dcf098f6533?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/8941/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8941 +/- ##
=======================================
Coverage 58.97% 58.97%
=======================================
Files 359 359
Lines 11333 11333
Branches 2787 2787
=======================================
Hits 6684 6684
Misses 4471 4471
Partials 178 178
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/8941?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/8941?src=pr&el=footer). Last update [2d456e8...ef9f9e2](https://codecov.io/gh/apache/incubator-superset/pull/8941?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] robdiciuccio commented on a change in pull
request #8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
robdiciuccio commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366117073
##########
File path: superset/views/dashboard/api.py
##########
@@ -356,3 +361,52 @@ def delete(self, item): # pylint: disable=arguments-differ
return self.response(200, message="OK")
except SQLAlchemyError as e:
return self.response_422(message=str(e))
+
+ @expose("/export/", methods=["GET"])
+ @protect()
+ @safe
+ @rison(get_export_ids_schema)
+ def export(self, **kwargs):
+ """Export dashboards
+ ---
+ get:
+ parameters:
+ - in: query
+ name: q
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: integer
+ responses:
+ 200:
+ description: Dashboard export
+ content:
+ text/plain:
+ schema:
+ type: string
+ 400:
+ $ref: '#/components/responses/400'
+ 401:
+ $ref: '#/components/responses/401'
+ 404:
+ $ref: '#/components/responses/404'
+ 422:
+ $ref: '#/components/responses/422'
+ 500:
+ $ref: '#/components/responses/500'
+ """
+ query = self.datamodel.session.query(Dashboard).filter(
+ Dashboard.id.in_(kwargs["rison"])
+ )
+ query = self._base_filters.apply_all(query)
+ ids = [item.id for item in query.all()]
+ if not ids:
+ return self.response_404()
+ export = Dashboard.export_dashboards(kwargs["rison"])
Review comment:
`Dashboard.export_dashboards(ids)`?
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366195433
##########
File path: superset/views/dashboard/views.py
##########
@@ -44,8 +44,7 @@ class DashboardModelView(
datamodel = SQLAInterface(models.Dashboard)
@action("mulexport", __("Export"), __("Export dashboards?"), "fa-database")
- @staticmethod
- def mulexport(items):
+ def mulexport(self, items): # pylint: disable=no-self-use
Review comment:
It's related with this already merged PR: https://github.com/apache/incubator-superset/pull/8942
the `@action` decorator creates a methods attribute on the method, this is defeated by making the method static
----------------------------------------------------------------
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] suddjian commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
suddjian commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366082463
##########
File path: tests/dashboard_api_tests.py
##########
@@ -423,3 +423,40 @@ def test_get_related_fail(self):
rv = self.client.get(uri)
self.assertEqual(rv.status_code, 404)
+
+ def test_export(self):
+ """
+ Dashboard API: Test dashboard export
+ """
+ self.login(username="admin")
+ argument = [1, 2]
+ uri = f"api/v1/dashboard/export/?q={prison.dumps(argument)}"
+
+ rv = self.client.get(uri)
+ self.assertEqual(rv.status_code, 200)
+ rv.headers["Content-Disposition"] = 'attachment; filename="dashboards.json"'
Review comment:
Is this line supposed to be asserting something?
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366202445
##########
File path: tests/dashboard_api_tests.py
##########
@@ -423,3 +423,40 @@ def test_get_related_fail(self):
rv = self.client.get(uri)
self.assertEqual(rv.status_code, 404)
+
+ def test_export(self):
+ """
+ Dashboard API: Test dashboard export
+ """
+ self.login(username="admin")
+ argument = [1, 2]
+ uri = f"api/v1/dashboard/export/?q={prison.dumps(argument)}"
+
+ rv = self.client.get(uri)
+ self.assertEqual(rv.status_code, 200)
+ rv.headers["Content-Disposition"] = 'attachment; filename="dashboards.json"'
Review comment:
No, but now it is
----------------------------------------------------------------
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] robdiciuccio commented on a change in pull
request #8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
robdiciuccio commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366117073
##########
File path: superset/views/dashboard/api.py
##########
@@ -356,3 +361,52 @@ def delete(self, item): # pylint: disable=arguments-differ
return self.response(200, message="OK")
except SQLAlchemyError as e:
return self.response_422(message=str(e))
+
+ @expose("/export/", methods=["GET"])
+ @protect()
+ @safe
+ @rison(get_export_ids_schema)
+ def export(self, **kwargs):
+ """Export dashboards
+ ---
+ get:
+ parameters:
+ - in: query
+ name: q
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: integer
+ responses:
+ 200:
+ description: Dashboard export
+ content:
+ text/plain:
+ schema:
+ type: string
+ 400:
+ $ref: '#/components/responses/400'
+ 401:
+ $ref: '#/components/responses/401'
+ 404:
+ $ref: '#/components/responses/404'
+ 422:
+ $ref: '#/components/responses/422'
+ 500:
+ $ref: '#/components/responses/500'
+ """
+ query = self.datamodel.session.query(Dashboard).filter(
+ Dashboard.id.in_(kwargs["rison"])
+ )
+ query = self._base_filters.apply_all(query)
+ ids = [item.id for item in query.all()]
+ if not ids:
+ return self.response_404()
+ export = Dashboard.export_dashboards(kwargs["rison"])
Review comment:
`Dashboard.export_dashboards(ids)`?
----------------------------------------------------------------
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] robdiciuccio commented on a change in pull
request #8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
robdiciuccio commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366115353
##########
File path: superset/views/dashboard/api.py
##########
@@ -169,6 +173,7 @@ class DashboardRestApi(DashboardMixin, BaseSupersetModelRestApi):
method_permission_name = {
"get_list": "list",
"get": "show",
+ "export": "list",
Review comment:
Seems like a different level of permission if the export also contains all of the chart and data source info. Was this the `can_download_dashboards` permission? Can we use the same?
----------------------------------------------------------------
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] robdiciuccio commented on a change in pull
request #8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
robdiciuccio commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366118747
##########
File path: tests/dashboard_api_tests.py
##########
@@ -423,3 +423,40 @@ def test_get_related_fail(self):
rv = self.client.get(uri)
self.assertEqual(rv.status_code, 404)
+
+ def test_export(self):
+ """
+ Dashboard API: Test dashboard export
+ """
+ self.login(username="admin")
+ argument = [1, 2]
+ uri = f"api/v1/dashboard/export/?q={prison.dumps(argument)}"
Review comment:
So the final URL here looks like `api/v1/dashboard/export/?q=!(1,2)`?
----------------------------------------------------------------
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] dpgaspar merged pull request #8941:
[dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
dpgaspar merged pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941
----------------------------------------------------------------
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 #8941:
[dashboards] feat: export api
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #8941: [dashboards] feat: export api
URL: https://github.com/apache/incubator-superset/pull/8941#issuecomment-572606149
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=h1) Report
> Merging [#8941](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/2d456e88ebf1ef6fe4da7bdca1e25dcf098f6533?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/8941/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8941 +/- ##
=======================================
Coverage 58.97% 58.97%
=======================================
Files 359 359
Lines 11333 11333
Branches 2787 2787
=======================================
Hits 6684 6684
Misses 4471 4471
Partials 178 178
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/8941?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/8941?src=pr&el=footer). Last update [2d456e8...1d74a06](https://codecov.io/gh/apache/incubator-superset/pull/8941?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] nytai commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
nytai commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r365375319
##########
File path: superset/views/dashboard/api.py
##########
@@ -169,6 +173,7 @@ class DashboardRestApi(DashboardMixin, BaseSupersetModelRestApi):
method_permission_name = {
"get_list": "list",
"get": "show",
+ "export": "list",
Review comment:
👍 makes sense as it's essentially another form of list
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366202186
##########
File path: superset/views/dashboard/api.py
##########
@@ -169,6 +173,7 @@ class DashboardRestApi(DashboardMixin, BaseSupersetModelRestApi):
method_permission_name = {
"get_list": "list",
"get": "show",
+ "export": "list",
Review comment:
On this case is `mulexport` changed it
----------------------------------------------------------------
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] robdiciuccio commented on a change in pull
request #8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
robdiciuccio commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366117909
##########
File path: superset/views/dashboard/views.py
##########
@@ -44,8 +44,7 @@ class DashboardModelView(
datamodel = SQLAInterface(models.Dashboard)
@action("mulexport", __("Export"), __("Export dashboards?"), "fa-database")
- @staticmethod
- def mulexport(items):
+ def mulexport(self, items): # pylint: disable=no-self-use
Review comment:
What's the reasoning behind this change?
----------------------------------------------------------------
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 #8941:
[dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#issuecomment-572606149
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=h1) Report
> Merging [#8941](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/2d456e88ebf1ef6fe4da7bdca1e25dcf098f6533?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/8941/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8941 +/- ##
==========================================
+ Coverage 58.97% 58.98% +0.01%
==========================================
Files 359 359
Lines 11333 11336 +3
Branches 2787 2788 +1
==========================================
+ Hits 6684 6687 +3
Misses 4471 4471
Partials 178 178
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/8941?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set/assets/src/dashboard/actions/dashboardState.js](https://codecov.io/gh/apache/incubator-superset/pull/8941/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYXNzZXRzL3NyYy9kYXNoYm9hcmQvYWN0aW9ucy9kYXNoYm9hcmRTdGF0ZS5qcw==) | `40.96% <0%> (ø)` | :arrow_up: |
| [...explore/components/AdhocMetricEditPopoverTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/8941/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYXNzZXRzL3NyYy9leHBsb3JlL2NvbXBvbmVudHMvQWRob2NNZXRyaWNFZGl0UG9wb3ZlclRpdGxlLmpzeA==) | `70% <0%> (ø)` | :arrow_up: |
| [...src/dashboard/util/getFilterConfigsFromFormdata.js](https://codecov.io/gh/apache/incubator-superset/pull/8941/diff?src=pr&el=tree#diff-c3VwZXJzZXQvYXNzZXRzL3NyYy9kYXNoYm9hcmQvdXRpbC9nZXRGaWx0ZXJDb25maWdzRnJvbUZvcm1kYXRhLmpz) | `88.46% <0%> (+1.5%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/8941?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/8941?src=pr&el=footer). Last update [2d456e8...0ad95a7](https://codecov.io/gh/apache/incubator-superset/pull/8941?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] dpgaspar commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r365145933
##########
File path: superset/views/dashboard/api.py
##########
@@ -169,6 +173,7 @@ class DashboardRestApi(DashboardMixin, BaseSupersetModelRestApi):
method_permission_name = {
"get_list": "list",
"get": "show",
+ "export": "list",
Review comment:
Switched export to a `list` permission to reduce the amount of permissions
----------------------------------------------------------------
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] dpgaspar commented on a change in pull request
#8941: [dashboards] New, export api
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #8941: [dashboards] New, export api
URL: https://github.com/apache/incubator-superset/pull/8941#discussion_r366195580
##########
File path: tests/dashboard_api_tests.py
##########
@@ -423,3 +423,40 @@ def test_get_related_fail(self):
rv = self.client.get(uri)
self.assertEqual(rv.status_code, 404)
+
+ def test_export(self):
+ """
+ Dashboard API: Test dashboard export
+ """
+ self.login(username="admin")
+ argument = [1, 2]
+ uri = f"api/v1/dashboard/export/?q={prison.dumps(argument)}"
Review comment:
exactly
----------------------------------------------------------------
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