-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adds the /explore endpoint to the v1 API #20399
feat: Adds the /explore endpoint to the v1 API #20399
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20399 +/- ##
==========================================
+ Coverage 66.72% 66.83% +0.11%
==========================================
Files 1739 1744 +5
Lines 65130 65380 +250
Branches 6898 6898
==========================================
+ Hits 43459 43698 +239
- Misses 19921 19932 +11
Partials 1750 1750
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving explore endpoint, I have a first quick review and leave some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Can you add unittests for GetExploreCommand
also
CC @eric-briscoe since you were interested in this project 🙂 |
Thanks for your review @dpgaspar. I really appreciate it! I noticed that many concepts are shared among API schema definitions (database, form_data, dataset, etc). Currently, some are duplicated in each endpoint and are inconsistent with one another. One thing we could do in a follow-up is to create many of the schema concepts in a more global way, to share both structure and documentation. We should also provide the ability to export a concept partially like just exposing some specific properties of the global database definition. This would improve our API standardization a lot not only by ensuring an object is correctly defined but also that the documentation associated with that object is consistent among endpoints. |
36888a3
to
41953a3
Compare
Since the API is pretty much invoking the |
sounds promising! |
I understand, my current concern is that the defined response payload is complex and I don't see them been asserted on the API tests, for example |
btw, we are currently adding this: https://github.com/apache/superset/blob/master/superset/views/core.py#L1352 |
Nice! I'll add this to the old explore endpoint as well. |
@dpgaspar I added the assertions to I also added the warning to the old explore endpoint. |
* feat: Adds the /explore endpoint to the v1 API * Fixes pylint errors * Fixes tests * Changes the tests logic * Removes ABC reference * Improves indentation * Addresses review comments * Rebases code * Improves dataset and slice assertions * Fixes tests * Removes schema and table name assertions * Removes fixed IDs * Fixes datasource ID
SUMMARY
This PR is part of the Single Page App initiative and it adds the
/explore
endpoint to thev1
API. The previous legacy endpoint insuperset.views.core
was responsible not only for assembling the Explore context but also to save Explore-related information. This endpoint, however, does not contain any save operation. We should use the existingv1
endpoints to save the charts and dashboard relationships. Another important difference is that this endpoint does not return shared bootstrap data such asuser
,permissions
,common
, etc. as these are already available by other means.The legacy endpoint also contained redirects and flash messages. These were transformed into HTTP response errors/values and should be handled by the client-side.
Much of the code in the new endpoint comes from the legacy one. It's important to mention that it is not the objective of the PR to refactor the code at this point to avoid introducing potential regressions.
We will remove the legacy endpoint after the SPA initiative is completed.
TESTING INSTRUCTIONS
1 - Execute the API tests
2 - All tests should pass
ADDITIONAL INFORMATION