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(snowflake): get_catalog_names #23602

Merged
merged 1 commit into from
Apr 6, 2023
Merged

Conversation

betodealmeida
Copy link
Member

SUMMARY

Implement get_catalog_names for Snowflake. This is needed to support catalog-level permissions, and also for #22862.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

I configured a Snowflake database and ran this script:

from superset.app import create_app

app = create_app()
with app.app_context():
    from superset import db
    from superset.db_engine_specs.snowflake import SnowflakeEngineSpec
    from superset.models.core import Database

    database = db.session.query(Database).first()
    with database.get_inspector_with_context() as inspector:
        print(SnowflakeEngineSpec.get_catalog_names(database, inspector))

When ran, it produced the expected output:

['SNOWFLAKE_SAMPLE_DATA']      

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 Apr 6, 2023

Codecov Report

Merging #23602 (2f326df) into master (c5eecc7) will increase coverage by 0.00%.
The diff coverage is 85.71%.

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

@@           Coverage Diff           @@
##           master   #23602   +/-   ##
=======================================
  Coverage   67.72%   67.72%           
=======================================
  Files        1916     1916           
  Lines       74051    74058    +7     
  Branches     8040     8040           
=======================================
+ Hits        50153    50159    +6     
- Misses      21850    21851    +1     
  Partials     2048     2048           
Flag Coverage Δ
hive 52.75% <85.71%> (+<0.01%) ⬆️
mysql 78.49% <85.71%> (+<0.01%) ⬆️
postgres 78.57% <85.71%> (+<0.01%) ⬆️
presto 52.68% <85.71%> (+<0.01%) ⬆️
python 82.41% <85.71%> (+<0.01%) ⬆️
sqlite 77.07% <85.71%> (+<0.01%) ⬆️
unit 52.65% <85.71%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/db_engine_specs/snowflake.py 67.25% <80.00%> (+0.38%) ⬆️
superset/db_engine_specs/bigquery.py 69.66% <100.00%> (+0.11%) ⬆️
superset/db_engine_specs/postgres.py 97.12% <100.00%> (+0.02%) ⬆️

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

@betodealmeida betodealmeida merged commit 8d14420 into master Apr 6, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the snowflake_get_catalog_names branch March 26, 2024 18:02
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/S 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants