Skip to content

feat(py): A dbt adapter for Feldera (not a Feldera adapter, but a dbt adapter, that is wrapping Feldera)#5950

Open
mdrakiburrahman wants to merge 40 commits intofeldera:mainfrom
mdrakiburrahman:dev/mdrrahman/dbt-feldera
Open

feat(py): A dbt adapter for Feldera (not a Feldera adapter, but a dbt adapter, that is wrapping Feldera)#5950
mdrakiburrahman wants to merge 40 commits intofeldera:mainfrom
mdrakiburrahman:dev/mdrrahman/dbt-feldera

Conversation

@mdrakiburrahman
Copy link
Copy Markdown

@mdrakiburrahman mdrakiburrahman commented Mar 30, 2026

A new dbt adapter for Feldera.


Small demo

Demo walkthrough

Notes


Describe Manual Test Plan

Includes a dbt-adventureworks Integration test that runs both PyTest and dbt CLI with bash. Uses Feldera in docker.

There is a .scripts/run.sh all target that runs all targets of the new Python project locally, see the dbt-feldera/README.md:

image

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated
  • Changelog updated

Breaking Changes?

Mark if you think the answer is yes for any of these components:

  • OpenAPI / REST HTTP API / feldera-types / manager (What is a breaking change?)
  • Feldera SQL (Syntax, Semantics)
  • feldera-sqllib (incl. dependencies fxp, etc.) (What is a breaking change?)
  • Python SDK (What is a breaking change?) (No, but this includes a new Python project adjacent to it)
  • fda (CLI arguments)
  • Adapters (including configuration)
  • Storage Format / Checkpoints
  • Others (specify): A new Python project and some additive devcontainer changes

Describe Incompatible Changes

N/A

Issue

Closes #5794

…w count. TODO: Assert IVM by adding more data to source, perhaps via Kafka
@blp blp self-requested a review March 30, 2026 15:28
@blp
Copy link
Copy Markdown
Member

blp commented Mar 30, 2026

I was going to review this but on first glance I don't understand it at all. Feldera adapters are written in Rust and go in the adapters crate. This is something else completely different written in Python and I don't see how it is a Feldera adapter at all.

@mdrakiburrahman
Copy link
Copy Markdown
Author

mdrakiburrahman commented Mar 30, 2026

Hey @blp,

This is not a Feldera adapter, this is a dbt adapter:

https://www.getdbt.com/

dbt is a super popular CLI tool used by Data Engineers/Analysts. The idea of building a dbt adapter is to increase Feldera adoption amongst laymans.

Here are some dbt adapters for other ETL/Database engines, they're all written in Python:

https://github.com/dbt-labs/dbt-adapters

I suppose whoever wrote the Python client for Feldera would be a more suitable reviewer, as this PR is using that client to bridge dbt to feldera.

@blp
Copy link
Copy Markdown
Member

blp commented Mar 30, 2026

Hey @blp,

This is not a Feldera adapter, this is a dbt adapter:

https://www.getdbt.com/

OK. I will remove myself from the reviewers list, because I am not the right person to look at this.

@blp blp removed their request for review March 30, 2026 17:39
@lalithsuresh
Copy link
Copy Markdown
Contributor

@mdrakiburrahman Mihai should definitely look at this, but is traveling so might be slow to reply. In the meantime, tagging in @snkas who understands the python API well.

@mdrakiburrahman
Copy link
Copy Markdown
Author

mdrakiburrahman commented Mar 30, 2026

@lalithsuresh - no rush! I still have a few TODOs to get this PR merge worthy, but I'm curious to get feedback on how I'm bridging the SQL to REST API ~~(currently it's janky RegEx 🙃) - I'm changing to sqlglot - it's a zero-dep Python based SQL Parser (it's awesome, similar to Calcite)

@gz
Copy link
Copy Markdown
Contributor

gz commented Mar 30, 2026

also @abhizer

@gz gz requested a review from abhizer March 30, 2026 19:47
@mdrakiburrahman
Copy link
Copy Markdown
Author

@gz would you mind allowing CI to run on the latest commit? I was seeing a ruff lint failure in GH Action, hopefully this fixes it

Ruff 0.9.10 (used by pre-commit CI) classifies dbt_common as
third-party and dbt.adapters.* as first-party due to the project's
setuptools namespace package config. This means dbt_common imports
must appear in the third-party section (before the blank-line
separator), not interleaved with the first-party dbt.adapters block.

Co-authored-by: Copilot <[email protected]>
@gz
Copy link
Copy Markdown
Contributor

gz commented Apr 3, 2026

looks like it passed pre-merge queue. if you think it's in good shape I can clone the branch and trigger a run for the merge queue so that it doesnt actually merge it yet. but it may reveal some issues with CI scripts. let me know if you think it's ready to be tried.

@mdrakiburrahman
Copy link
Copy Markdown
Author

@gz let's do it!

Copy link
Copy Markdown
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

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

I am still on vacation, so I will review more when I get a chance.
I apologize for the slow process.
I will be out for one more week.

@mdrakiburrahman
Copy link
Copy Markdown
Author

I am still on vacation, so I will review more when I get a chance. I apologize for the slow process. I will be out for one more week.

@mihaibudiu no problem at all 🙂 I appreciate you taking the time over the time off.
Will review your latest comments.

I'm not in a rush to merge since there's minimal chances of merge conflicts

@gz
Copy link
Copy Markdown
Contributor

gz commented Apr 3, 2026

https://github.com/feldera/feldera/actions/runs/23948791970

@mdrakiburrahman
Copy link
Copy Markdown
Author

@gz - 1 hour 18 mins, pretty fast post-merge queue!

@gz
Copy link
Copy Markdown
Contributor

gz commented Apr 3, 2026

I am trying to find the dbt integration tests but I think they aren't wired into ci.yml, but looks like the unit tests worked 🚀

@mdrakiburrahman
Copy link
Copy Markdown
Author

@gz yea I removed the dbt integration tests from this PR, I'll get it done in #5966

Currently the integration test only works locally with Docker

@mythical-fred
Copy link
Copy Markdown

Feldera uses rebase-merge, not squash. Every commit in the PR lands individually on main — each with its own message, authored by you. You can verify this by looking at any recently-merged multi-commit PR (e.g. PR #5956 had two commits and both appear separately on main: fc3dd4d and 7d27972).

So yes, the commit messages matter here. 30 commits with checkpoint notes, merge commits, and fixup messages will all become permanent git history.

The fix is straightforward: git rebase -i origin/main to squash, reword, and restructure into a clean sequence. Aim for around 5-10 logical commits that each explain why a change was made. The two merge commits especially need to go (d8afa71e, 044063cc, 2cafef7d, fd88b16d).

References:

@mythical-fred
Copy link
Copy Markdown

CI passed — good. The commit history still needs the rebase you mentioned in step 3 of your plan. Still seeing checkpoint commits, merge commits, and 'Attempt to lint' scattered through it. Please squash/rebase to a clean logical sequence before I can lift CHANGES_REQUESTED.

Copy link
Copy Markdown

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

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

Commit history still needs cleanup. Still seeing "Checkpoint:", "Fixed catalog gen", "Proofread", double "Update changelog", "Remove seeds from git in origin", and three merge-from-main commits. Please squash or rebase into a clean sequence before merge. Also, Mihai left a batch of inline questions on April 3 that appear unanswered — worth addressing those first.

@gz
Copy link
Copy Markdown
Contributor

gz commented Apr 4, 2026

If it's not obvious @mythical-fred is our LLM reviewer, he gets fixated on things sometimes :)

@mythical-fred
Copy link
Copy Markdown

Fair point, @gz — CI is green now. @mdrakiburrahman: the only remaining ask is the rebase. Once the history is clean I'll dismiss my REQUEST_CHANGES.

@mdrakiburrahman
Copy link
Copy Markdown
Author

mdrakiburrahman commented Apr 5, 2026

@gz wow could have had me fooled 🤣 I thought it was a git connoisseur engineer

@mythical-fred - calm down robot! I'll do my rebase after finishing the review with Mihai.

Btw we solve all these problems in our repo by enforcing Squash merge. So the developer can push as many commits as they want in their PR branch to get CI green etc, but when it merges to main it shows up as a single clean commit:

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits

image

(Rebasing can sometimes be stressful unless you're used to it, I've messed up my working branches before but I'm personally not very good at git)

mdrakiburrahman and others added 10 commits April 5, 2026 14:05
The dev dependency used ruff>=0.6.9 which resolved to 0.15.8, while CI
pre-commit uses ruff 0.9.10. These versions produce different isort
import ordering for dbt namespace packages, causing run.sh fix to undo
the CI-expected ordering. Pinning ensures local and CI ruff agree.

Co-authored-by: Copilot <[email protected]>
@mdrakiburrahman
Copy link
Copy Markdown
Author

Hey @mihaibudiu,

I think I got your suggestions in the latest batch of commits.

No rush, whenever you're available, please take a look at the latest iteration.

Btw, if you wanted to co-author this branch, please let me know!

I can help get you setup locally (see CONTRIBUTING.md), it's fairly quick to make code changes and fire .scripts/run.sh all to regression test the dbt adapter against a real integration test environment in ~5 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a dbt connector for Feldera

8 participants