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

fix: auto-complete of tables and names are not working in SQL lab #19152

Merged

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

Currently table names are not added to autocomplete in SQL Lab

When the schema is selected, then a query is made to fetch the tables for the database/schema combination.
Those options were not properly propagated and stored in the reducer, thus the tables never appeared.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-03-15.at.09.58.49.mov

After:

Screen.Recording.2022-03-15.at.09.56.51.mov

TESTING INSTRUCTIONS

  1. Go to SQL Lab
  2. Choose the Examples database and related schema (Pubic for Postgres)
  3. Check a name of a table ("Flights" should be present)
  4. Type "select * from Fli" in the Editor and notice that "Flights" doesn't appear in the dropdown

ADDITIONAL INFORMATION

Fixes #19008

  • 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

@diegomedina248 diegomedina248 force-pushed the fix/auto-complete-tables-in-sql-lab branch from 096b2a4 to 61dbdd5 Compare March 16, 2022 22:53
@rusackas
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@rusackas Ephemeral environment spinning up at http://54.202.246.98:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@codecov
Copy link

codecov bot commented Mar 16, 2022

Codecov Report

Merging #19152 (2c623cb) into master (8d53db1) will increase coverage by 0.00%.
The diff coverage is 40.00%.

❗ Current head 2c623cb differs from pull request most recent head 61dbdd5. Consider uploading reports for the commit 61dbdd5 to get more accurate results

@@           Coverage Diff           @@
##           master   #19152   +/-   ##
=======================================
  Coverage   66.54%   66.54%           
=======================================
  Files        1646     1646           
  Lines       63630    63638    +8     
  Branches     6475     6477    +2     
=======================================
+ Hits        42343    42350    +7     
- Misses      19607    19609    +2     
+ Partials     1680     1679    -1     
Flag Coverage Δ
javascript 51.30% <40.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...d/src/SqlLab/components/AceEditorWrapper/index.tsx 44.82% <0.00%> (-8.75%) ⬇️
...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx 56.75% <55.55%> (+0.09%) ⬆️
...et-frontend/src/components/TableSelector/index.tsx 68.29% <100.00%> (+5.64%) ⬆️
superset-frontend/src/components/Select/Select.tsx 86.32% <0.00%> (+1.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d53db1...61dbdd5. Read the comment docs.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

Looks (and works) great! Thank you!

setTableOptions(options);
setCurrentTable(currentTable);
setLoadingTables(false);
if (forceRefresh) addSuccessToast('List updated');
})
.catch(e => {
.catch(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the extra cleanup along the way!

@rusackas rusackas merged commit 3b427b2 into apache:master Mar 17, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@sadpandajoe
Copy link
Member

🏷️ preset:2022.11

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 17, 2022
villebro pushed a commit that referenced this pull request Apr 3, 2022
@mistercrunch mistercrunch added 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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 lts-v1 preset:2022.11 Preset-Patch size/L 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table name autocomplete broken in SQL Lab
5 participants