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: add YDB as a new database engine #31141

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

vgvoleg
Copy link
Contributor

@vgvoleg vgvoleg commented Nov 25, 2024

SUMMARY

This PR provides YDB database support based on YDB Dialect

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Steps needed to install sqlalchemy dialect described on databases.mdx.

To test it you can start local YDB via docker-compose:

version: "3.3"
services:
  ydb:
    image: ydbplatform/local-ydb:trunk
    restart: always
    ports:
      - 2136:2136
    hostname: localhost
    environment:
      - YDB_USE_IN_MEMORY_PDISKS=true
      - YDB_ENABLE_COLUMN_TABLES=true

sqlalchemy uri will be like

ydb://localhost:2136/local

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

@github-actions github-actions bot added the doc Namespace | Anything related to documentation label Nov 25, 2024
@dosubot dosubot bot added data:connect Namespace | Anything related to db connections / integrations enhancement:db Suggest new DB connections labels Nov 25, 2024
@vgvoleg vgvoleg force-pushed the support-ydb-database branch from 4389a74 to 7ab18c0 Compare November 25, 2024 08:56
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 89.58333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.81%. Comparing base (76d897e) to head (ffb2309).
Report is 1135 commits behind head on master.

Files with missing lines Patch % Lines
superset/db_engine_specs/ydb.py 89.58% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #31141       +/-   ##
===========================================
+ Coverage   60.48%   83.81%   +23.33%     
===========================================
  Files        1931      537     -1394     
  Lines       76236    38980    -37256     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32673    -13441     
+ Misses      28017     6307    -21710     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.79% <56.25%> (-0.37%) ⬇️
javascript ?
mysql 76.56% <56.25%> (?)
postgres 76.62% <56.25%> (?)
presto 53.29% <56.25%> (-0.52%) ⬇️
python 83.81% <89.58%> (+20.33%) ⬆️
sqlite 76.08% <56.25%> (?)
unit 60.91% <89.58%> (+3.28%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vgvoleg vgvoleg force-pushed the support-ydb-database branch from 7ab18c0 to 8c5ba7f Compare November 25, 2024 10:27
@vgvoleg vgvoleg changed the title Add YDB as a new database engine feat: add YDB as a new database engine Nov 25, 2024
@vgvoleg vgvoleg force-pushed the support-ydb-database branch from 8c5ba7f to 129462a Compare November 25, 2024 12:07
docs/docs/configuration/databases.mdx Outdated Show resolved Hide resolved
superset/db_engine_specs/ydb.py Outdated Show resolved Hide resolved
superset/db_engine_specs/ydb.py Show resolved Hide resolved
superset/db_engine_specs/ydb.py Outdated Show resolved Hide resolved
superset/db_engine_specs/ydb.py Outdated Show resolved Hide resolved
superset/db_engine_specs/ydb.py Outdated Show resolved Hide resolved
@giftig
Copy link
Contributor

giftig commented Nov 25, 2024

Also the logic in your spec should have some unit tests.

Copy link
Contributor

@giftig No ephemeral environment action detected. Please use '/testenv up' or '/testenv down'. View workflow run.

@giftig
Copy link
Contributor

giftig commented Nov 25, 2024

/testenv up

Copy link
Contributor

@giftig Processing your ephemeral environment request here.

@giftig
Copy link
Contributor

giftig commented Nov 25, 2024

Can you also provide some test instructions for how to verify this is working / describe what you tested, please? I'm assuming it's mostly just install the ydb driver, connect a ydb database, and try running some queries and building some dashboards, but maybe others will catch some edge case testing which may be useful with a new engine spec.

Copy link
Contributor

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

@vgvoleg vgvoleg force-pushed the support-ydb-database branch 3 times, most recently from 4b28fb7 to a414bb7 Compare November 26, 2024 16:14
@vgvoleg vgvoleg changed the title feat: add YDB as a new database engine [WIP] feat: add YDB as a new database engine Nov 26, 2024
@vgvoleg vgvoleg force-pushed the support-ydb-database branch 3 times, most recently from 98f26cf to aa9b089 Compare November 28, 2024 09:36
@vgvoleg vgvoleg changed the title [WIP] feat: add YDB as a new database engine feat: add YDB as a new database engine Nov 28, 2024
@vgvoleg vgvoleg force-pushed the support-ydb-database branch from aa9b089 to 4367dd6 Compare November 28, 2024 09:41
@vgvoleg vgvoleg force-pushed the support-ydb-database branch from 4367dd6 to ffb2309 Compare November 28, 2024 09:43
@vgvoleg vgvoleg requested a review from giftig November 28, 2024 09:54
Copy link
Contributor

@giftig giftig left a comment

Choose a reason for hiding this comment

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

Minor comments / questions but looks good to me.

I haven't had chance to try running your branch with YDB though, and we'll probably need to check if there's a process for including that ydb.svg, so we should wait for some more reviews.

superset/db_engine_specs/ydb.py Show resolved Hide resolved
connect_args["protocol"] = encrypted_extra["protocol"]

if "credentials" in encrypted_extra:
credentials_info = encrypted_extra["credentials"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This argument seems unnecessary, could just be one line like L100

superset/db_engine_specs/ydb.py Show resolved Hide resolved
tests/unit_tests/db_engine_specs/test_ydb.py Show resolved Hide resolved
tests/unit_tests/db_engine_specs/test_ydb.py Show resolved Hide resolved
@betodealmeida betodealmeida merged commit cf5c770 into apache:master Dec 5, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:connect Namespace | Anything related to db connections / integrations doc Namespace | Anything related to documentation enhancement:db Suggest new DB connections size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants