Skip to content

feat(database): SIP-195 Add MongoDB database engine support - #37307

Closed
passren wants to merge 0 commit into
apache:masterfrom
passren:SIP-195--Add-mongodb-dbengine
Closed

passren wants to merge 0 commit into
apache:masterfrom
passren:SIP-195--Add-mongodb-dbengine

Conversation

@passren

@passren passren commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Add MongoDB database engine specification, enabling users to connect to MongoDB databases and write SQL queries on MongoDB collections using the PyMongoSQL dialect.

This implementation:

  • Creates MongoDBEngineSpec class that extends BaseEngineSpec with MongoDB-specific configurations
  • Implements datetime conversion methods (convert_dttm and epoch_to_dttm) for MongoDB compatibility
  • Supports time grain expressions for MongoDB temporal queries
  • Includes comprehensive unit tests for datetime conversion across multiple column types
  • Adds documentation for MongoDB database configuration

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A - Backend database engine support addition, no UI changes

TESTING INSTRUCTIONS

  • Run unit tests for tests/unit_tests/db_engine_specs/test_mongodb.py

  • Integration Test in UI
    database_connections
    sql_lab_query

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

@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@dosubot dosubot Bot added the data:connect Namespace | Anything related to db connections / integrations label Jan 21, 2026
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt AI finished reviewing your PR.

@netlify

netlify Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 87bbd54
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/697276e9ea8ec40008d77c88
😎 Deploy Preview https://deploy-preview-37307--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Jan 21, 2026
@passren

passren commented Jan 21, 2026

Copy link
Copy Markdown
Contributor Author

This PR is related to SIP-195

@codecov

codecov Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.60%. Comparing base (6eb4db6) to head (7a13cf1).
⚠️ Report is 72 commits behind head on master.

Files with missing lines Patch % Lines
superset/db_engine_specs/mongodb.py 75.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #37307       +/-   ##
===========================================
+ Coverage        0   67.60%   +67.60%     
===========================================
  Files           0      645      +645     
  Lines           0    48335    +48335     
  Branches        0     5300     +5300     
===========================================
+ Hits            0    32678    +32678     
- Misses          0    14366    +14366     
- Partials        0     1291     +1291     
Flag Coverage Δ
hive 42.69% <75.00%> (?)
mysql 65.64% <75.00%> (?)
postgres 65.68% <75.00%> (?)
presto 46.28% <75.00%> (?)
python 67.57% <75.00%> (?)
sqlite 65.41% <75.00%> (?)
unit 100.00% <ø> (?)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #3a496b

Actionable Suggestions - 2
  • docs/docs/configuration/databases.mdx - 1
  • superset/db_engine_specs/mongodb.py - 1
Review Details
  • Files reviewed - 3 · Commit Range: 21d3899..21d3899
    • docs/docs/configuration/databases.mdx
    • superset/db_engine_specs/mongodb.py
    • tests/unit_tests/db_engine_specs/test_mongodb.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread docs/docs/configuration/databases.mdx Outdated
Comment thread superset/db_engine_specs/mongodb.py Outdated
@bito-code-review

bito-code-review Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4bf415

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 21d3899..10cd4ac
    • docs/docs/configuration/databases.mdx
    • superset/db_engine_specs/mongodb.py
    • tests/unit_tests/db_engine_specs/test_mongodb.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for MongoDB as a database engine in Superset, enabling users to connect to MongoDB databases and query collections using SQL through the PyMongoSQL dialect.

Changes:

  • Adds MongoDBEngineSpec class with datetime conversion methods and time grain expressions
  • Implements comprehensive unit tests for the MongoDB engine specification
  • Documents MongoDB connection setup and requirements

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
superset/db_engine_specs/mongodb.py New MongoDB engine specification with SQLite-like datetime functions and time grain expressions
tests/unit_tests/db_engine_specs/test_mongodb.py Unit tests for datetime conversion, epoch handling, time grain expressions, and engine metadata
docs/docs/configuration/databases.mdx Documentation for MongoDB connection strings and PyMongoSQL installation

Comment thread superset/db_engine_specs/mongodb.py Outdated
Comment thread tests/unit_tests/db_engine_specs/test_mongodb.py Outdated
Comment thread superset/db_engine_specs/mongodb.py Outdated
Comment thread superset/db_engine_specs/mongodb.py Outdated

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #c91ae0

Actionable Suggestions - 1
  • tests/unit_tests/db_engine_specs/test_mongodb.py - 1
Review Details
  • Files reviewed - 3 · Commit Range: 10cd4ac..7a13cf1
    • docs/docs/configuration/databases.mdx
    • superset/db_engine_specs/mongodb.py
    • tests/unit_tests/db_engine_specs/test_mongodb.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread tests/unit_tests/db_engine_specs/test_mongodb.py Outdated
@sfirke

sfirke commented Jan 21, 2026

Copy link
Copy Markdown
Member

Hi @passren - please take a look at #36805 which was just merged a half-hour ago. That was a big improvement to how we generate documentation about databases, but it might require you to refactor some of your work to fit that new template. Please try merging/rebasing to incorporate those changes and reconcile.

@bito-code-review

bito-code-review Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #144ff5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 7a13cf1..d2a6fc0
    • docs/docs/configuration/databases.mdx
    • superset/db_engine_specs/mongodb.py
    • tests/unit_tests/db_engine_specs/test_mongodb.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

Yep... sorry for the bad timing on #36805 but now with the proper metadata in the engine spec (and the logo) the docs (and Superset home page) will build themselves automatically.

@passren

passren commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

Yep... sorry for the bad timing on #36805 but now with the proper metadata in the engine spec (and the logo) the docs (and Superset home page) will build themselves automatically.

Haha... no worries at all. I'm looking at this PR. It's pretty straightforward.

@passren passren closed this Jan 22, 2026
@passren
passren force-pushed the SIP-195--Add-mongodb-dbengine branch from d2a6fc0 to 87bbd54 Compare January 22, 2026 19:13
@passren
passren deleted the SIP-195--Add-mongodb-dbengine branch January 22, 2026 19:21
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 size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants