dbt-core icon indicating copy to clipboard operation
dbt-core copied to clipboard

Run dbt on WebAssembly using Pyodide

Open arieldbt opened this issue 2 years ago • 8 comments

Description

Changes needed to run dbt in the browser (using WebAssembly via Pyodide). For more context on the rationale see the discussion in github and our community slack. Here is a demo of the jaffle shop example project using sqlite and dbt in the browser:

https://s3.amazonaws.com/com.getdbt.cloud.wasm/index.html

To enable running dbt on WebAssembly I needed to refactor two parts of the codebase into clients since they behave differently in a browser compared to a normal operating system:

  1. HTTP requests
  2. Parallel processing

Checklist

  • [x] I have read the contributing guide and understand what's expected of me
  • [x] I have signed the CLA
  • [x] I have run this code in development and it appears to resolve the stated issue
  • [x] This PR includes tests, or tests are not required/relevant for this PR
  • [x] I have opened an issue to add/update docs, or docs changes are not required/relevant for this PR
  • [x] I have run changie new to create a changelog entry

arieldbt avatar Sep 09 '22 19:09 arieldbt

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @arieldbt

cla-bot[bot] avatar Sep 09 '22 19:09 cla-bot[bot]

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

github-actions[bot] avatar Sep 09 '22 19:09 github-actions[bot]

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @arieldbt

cla-bot[bot] avatar Sep 09 '22 19:09 cla-bot[bot]

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @arieldbt

cla-bot[bot] avatar Sep 09 '22 19:09 cla-bot[bot]

@cla-bot check

jtcohen6 avatar Sep 12 '22 09:09 jtcohen6

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Sep 12 '22 09:09 cla-bot[bot]

@arieldbt looks great! I probably will have more time to play with it in October!

ChenyuLInx avatar Sep 15 '22 22:09 ChenyuLInx

Ariel has moved on, so unless he wants to contribute to this as an external contributor...

I've run pre-commit on it, and there are a number of complaints from mypy. I didn't look closely at all of them, but I think the code in flags.py for Pyodide should probably go somewhere else at least.

gshank avatar Sep 21 '22 16:09 gshank

👋 - been a bit busy but happy to see if I can help with the pre-commit / code-quality checks.

Probably should have had the pre-commit hooks already set up on my machine. My bad.

ajmarcus avatar Sep 28 '22 23:09 ajmarcus

Closing in favor of https://github.com/dbt-labs/dbt-core/pull/6146

jtcohen6 avatar Nov 17 '22 11:11 jtcohen6