fix(explore): Fix chart standalone URL for report/thumbnail generation#20673
Conversation
There was a problem hiding this comment.
if this is false now, what's the current value? Do we still have a standalone url without the nav?
There was a problem hiding this comment.
I believe that now that Explore is in the SPA, the response doc just contains the SPA wrapper. I was assuming that get_resp doesn't download/execute the JS bundle, so I think these tests were only still passing by accident:
"Original value"and"List Roles"are contained in the embedded bootstrap data but I don't think that bootstrap data is used by Explore anymore (it uses API endpoints now)<div class="navbar'isn't present in either standalone or non-standalone mode anymore
So, it seemed like these tests don't test anything meaningful anymore, with the exception of the 404 test below. I looked around for examples of backend tests for Dashboard, but didn't see much and assumed they had also been removed when Dashboard was brought into the SPA.
|
Should we make the url parameter case insensitive where it is consumed? |
4496c46 to
3003312
Compare
Codecov Report
@@ Coverage Diff @@
## master #20673 +/- ##
==========================================
- Coverage 66.84% 66.14% -0.70%
==========================================
Files 1750 1754 +4
Lines 65896 66684 +788
Branches 7017 7049 +32
==========================================
+ Hits 44048 44111 +63
- Misses 20062 20776 +714
- Partials 1786 1797 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@ktmud I think I'd lean slightly towards keeping it case-sensitive on the client side, just to keep the server-client contract as explicit as possible, but no strong feelings either way! |
|
In general, restrictions on multi-choice or boolean inputs on the client side should be more relaxed unless it has security implications or significantly increases code complexity. This helps with usability---"you know my intention, just give me what I want already." |
|
/testenv up |
|
@rusackas Container image not yet published for this PR. Please try again when build is complete. |
|
@rusackas Ephemeral environment creation failed. Please check the Actions logs for details. |
|
Hi @codyml, I look into the related codebase. I think you just change one line to fix it. |
|
@codyml Thank you for the PR. Can we rebase this and check if there's any |
06410e8 to
e37caff
Compare
e37caff to
e1ade31
Compare
|
Thanks for the fix! The code looks great to me, but I can't fully test it, because for some reason the reports don't work for me on localhost (unrelated to this PR) |
There was a problem hiding this comment.
the boolean type can be implicitly converted to string.
Python 3.8.6 (default, Nov 11 2020, 23:52:15)
[Clang 12.0.0 (clang-1200.0.32.21)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> str(True)
'True'
>>> str(False)
'False'
>>>There was a problem hiding this comment.
For this one the implicit conversion to True was part of why the URL wasn't working: the frontend expected it to be lowercase, so I wanted to make that explicit. But, I did update the frontend so if others use implicit conversion from Python bool it should work!
zhaoyongjie
left a comment
There was a problem hiding this comment.
leave a no-blocking suggestion, others lgtm.
e4e2804 to
5051c24
Compare
Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
a3a61aa to
bc0c8cc
Compare
|
/testenv up FEATURE_THUMBNAILS=true |
|
@jinghua-qa Ephemeral environment spinning up at http://34.222.120.222:8080. Credentials are |
|
@michael-s-molina i am ok with merge this pr first if you think deck is low priority, and we probably need to cherry this in for release candidate. |
@jinghua-qa Let's merge this first and follow up with a fix to deck charts. |
|
Ephemeral environment shutdown and build artifacts deleted. |
|
🏷️ preset:2022.29 |
apache#20673) * Update explore URLs. * More URL fixes. * Make frontend accept true/false query params case-insensitively. * Fix URL mistake. Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> (cherry picked from commit 84d4302)
apache#20673) * Update explore URLs. * More URL fixes. * Make frontend accept true/false query params case-insensitively. * Fix URL mistake. Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>




SUMMARY
When Explore was moved into the SPA, it changed url from
/superset/exploreto/explore. This PR updates (hopefully) all of the URL references to/superset/explorethat weren't updated accordingly. In detail:/superset/explore/?{queryparams}-->/explore/?{queryparams}/superset/explore/table/{id}-->/explore/?dataset_type=table&dataset_id={id}/superset/explore/p/{hash}--> unchanged/superset/explore_json--> unchangedThis should hopefully fix thumbnail and alert generation and other broken links.
The following tweaks are also included:
standalonequery param istrueinstead ofTrue.Trueas a query param for the above, just in case.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
/testenv up FEATURE_THUMBNAILS=true)/testenv up FEATURE_ALERT_REPORTS=true)/superset/slice/{id}/standalone=trueresolve correctly to a standalone-mode chartADDITIONAL INFORMATION