Skip to content
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(sqllab): Show sql in the current result #24787

Merged
merged 4 commits into from
Sep 6, 2023

Conversation

justinpark
Copy link
Member

SUMMARY

Following #24329, SQLLab can run a portion of the sql editor without highlighted.
Like other 3rd party sql editor, it will be useful to display the current running sql in the result panel to identify the actual executed query.

Screenshot_2023-07-24_at_3_46_19_PM

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After:

after--show-sql.mov

Before:

before--show-sql.mov

TESTING INSTRUCTIONS

Go to sqllab
Run a query and check the result panel

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #24787 (f10ed73) into master (abb8e28) will increase coverage by 1.72%.
Report is 55 commits behind head on master.
The diff coverage is 76.77%.

❗ Current head f10ed73 differs from pull request most recent head 4a5ee98. Consider uploading reports for the commit 4a5ee98 to get more accurate results

@@            Coverage Diff             @@
##           master   #24787      +/-   ##
==========================================
+ Coverage   67.23%   68.95%   +1.72%     
==========================================
  Files        1902     1906       +4     
  Lines       73939    74126     +187     
  Branches     8176     8212      +36     
==========================================
+ Hits        49713    51117    +1404     
+ Misses      22113    20885    -1228     
- Partials     2113     2124      +11     
Flag Coverage Δ
javascript 55.83% <72.86%> (+0.08%) ⬆️
postgres ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...d/packages/superset-ui-chart-controls/src/types.ts 100.00% <ø> (ø)
...s/legacy-plugin-chart-country-map/src/countries.ts 100.00% <ø> (ø)
...s/legacy-plugin-chart-heatmap/src/controlPanel.tsx 57.14% <ø> (ø)
.../legacy-plugin-chart-heatmap/src/transformProps.js 0.00% <ø> (ø)
.../legacy-plugin-chart-world-map/src/controlPanel.ts 25.00% <ø> (ø)
...egacy-plugin-chart-world-map/src/transformProps.js 0.00% <ø> (ø)
...et-chart-deckgl/src/layers/Geojson/controlPanel.ts 50.00% <ø> (ø)
...egacy-preset-chart-deckgl/src/layers/Path/Path.jsx 0.00% <ø> (ø)
...reset-chart-deckgl/src/layers/Path/controlPanel.ts 50.00% <ø> (ø)
...preset-chart-deckgl/src/layers/Polygon/Polygon.jsx 0.00% <ø> (ø)
... and 220 more

... and 82 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@michael-s-molina
Copy link
Member

I'll leave the design review for @kasiazjc but I think we can truncate the query (add ...) to indicate that we're only showing part of the query.

@kasiazjc
Copy link
Contributor

kasiazjc commented Jul 25, 2023

I'll leave the design review for @kasiazjc but I think we can truncate the query (add ...) to indicate that we're only showing part of the query.

Thanks @michael-s-molina and thanks @justinpark for the PR!

I have a few suggestions:

  • in other places in the app we actually have a number of rows or the right side of the table and filters/title etc on the left side; I think it would make sense to switch the order in here too, because the sql line acts as a title. Below a screenshot for reference (from explore)
image
  • The sql field could have a max width and if the text (first line) doesn't fill that space, the sql input could shrink a little bit

  • if there is another line, more text that is longer than the max width of the container (as Michael said) there should be a truncation rule with "..." - this is a default truncation behavior we use across the app

  • and the last one - this is more of a question - I'm wondering if instead of showing a pop up with the sql query, would it be more useful to scroll and highlight the query in the sql query area at the top? Not sure if that would be even possible, but curious to hear your thoughts @michael-s-molina and @justinpark

@michael-s-molina
Copy link
Member

  • in other places in the app we actually have a number of rows or the right side of the table and filters/title etc on the left side; I think it would make sense to switch the order in here too, because the sql line acts as a title. Below a screenshot for reference (from explore)

Wow, that's a great suggestion. @justinpark Could we also display the number of rows using the Label (pill) component?

  • and the last one - this is more of a question - I'm wondering if instead of showing a pop up with the sql query, would it be more useful to scroll and highlight the query in the sql query area at the top? Not sure if that would be even possible, but curious to hear your thoughts @michael-s-molina and @justinpark

@justinpark If this is possible it would be an awesome UX!

@john-bodley john-bodley changed the title chore(sqllab): Show sql in the current result feat(sqllab): Show sql in the current result Jul 25, 2023
@justinpark
Copy link
Member Author

and the last one - this is more of a question - I'm wondering if instead of showing a pop up with the sql query, would it be more useful to scroll and highlight the query in the sql query area at the top?

@kasiazjc this is a good idea but it might be broken if a user modify the sql content which is not same from the ran query.

@justinpark
Copy link
Member Author

Could we also display the number of rows using the Label (pill) component?

Sure. I'll update accordingly

@kasiazjc
Copy link
Contributor

and the last one - this is more of a question - I'm wondering if instead of showing a pop up with the sql query, would it be more useful to scroll and highlight the query in the sql query area at the top?

@kasiazjc this is a good idea but it might be broken if a user modify the sql content which is not same from the ran query.

True, so I think for now let's keep the modal. Thanks!

@justinpark
Copy link
Member Author

justinpark commented Aug 4, 2023

I have a few suggestions:

in other places in the app we actually have a number of rows or the right side of the table and filters/title etc on the left side; I think it would make sense to switch the order in here too, because the sql line acts as a title. Below a screenshot for reference (from explore)
image
The sql field could have a max width and if the text (first line) doesn't fill that space, the sql input could shrink a little bit

if there is another line, more text that is longer than the max width of the container (as Michael said) there should be a truncation rule with "..." - this is a default truncation behavior we use across the app

@kasiazjc I updated the layout as you suggested. I also replaces the existing limit message by the tooltip (+ exclamation indicator when exists). Feel free to give any feedback at your convenience.

update--current-sql.mov

@justinpark
Copy link
Member Author

@kasiazjc circle back related to the update

@justinpark
Copy link
Member Author

@kasiazjc @michael-s-molina could you help a review again?

@michael-s-molina
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@michael-s-molina Ephemeral environment spinning up at http://34.214.125.159:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

>
<Label
css={css`
line-height: 17px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use theme object to calculate the line-height (16 is fine), font-size and margin-right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-s-molina updated by theme variables.

@justinpark justinpark force-pushed the chore--add-current-execute-sql branch from 4a5ee98 to 6a174e6 Compare August 24, 2023 18:48
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@justinpark
Copy link
Member Author

@kasiazjc I will remain open until next Tuesday and will merge it if you don't have any concerns.

@justinpark justinpark merged commit 2d4de51 into apache:master Sep 6, 2023
26 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

Ephemeral environment shutdown and build artifacts deleted.

darwinsubramaniam pushed a commit to darwinsubramaniam/superset that referenced this pull request Sep 7, 2023
sebastiankruk added a commit to sebastiankruk/superset that referenced this pull request Sep 9, 2023
* fix: Issue apache#24493; Resolved report selection menu in chart and dashboard page (apache#25157)

* fix: DML failures in SQL Lab (apache#25190)

* fix: All values being selected in Select (apache#25202)

* docs: fix wrong type in PREFERRED_DATABASES example (apache#25200)

Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com>

* docs: add CVEs for 2.1.1 (apache#25206)

* chore: back port 2.1.1 doc changes (apache#25165)

* feat(sqllab): Show sql in the current result (apache#24787)

* docs(FAQ): add answer re: necessary specs, copy-edit existing answer (apache#24992)

* fix: `is_select` (apache#25189)

* fix: Cypress test to force mouseover (apache#25209)

* fix(sqllab): Force trino client async execution (apache#24859)

* fix: granularity_sqla and GENERIC_CHART_AXES (apache#25213)

* chore: Convert deckgl class components to functional (apache#25177)

* fix: Cypress test to force mouseover (follow-up) (apache#25223)

* fix(docs): Fixing a typo in README.md (apache#25216)

* chore(read_csv): remove deprecated argument (apache#25226)

* chore(trino): remove unnecessary index checks (apache#25211)

---------

Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com>
Co-authored-by: Sandeep Patel <33354423+suicide11@users.noreply.github.com>
Co-authored-by: Hugh A. Miles II <hughmil3s@gmail.com>
Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
Co-authored-by: Carlos M <1761056+cmontemuino@users.noreply.github.com>
Co-authored-by: Daniel Vaz Gaspar <danielvazgaspar@gmail.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: JUST.in DO IT <justin.park@airbnb.com>
Co-authored-by: Sam Firke <sfirke@users.noreply.github.com>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: Rob Moore <giftig@users.noreply.github.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
Co-authored-by: yousoph <sophieyou12@gmail.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
@jinghua-qa
Copy link
Member

I filed this cosmetic issue for the yellow banner of the query limit, it looks like the yellow banner is now on the edge of the query filed.
#25288

jinghua-qa added a commit to preset-io/superset that referenced this pull request Sep 18, 2023
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants