-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
#5982 but for Ibis #6296
#5982 but for Ibis #6296
Conversation
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. |
after discussions w/ @jtcohen6 and @ChenyuLInx, noting here for posterity:
|
158aa81 makes the updates per suggestions the goodthe code is so much cleaner! and no longer uses hardcoded re-reading of my local profile, instead using the dbt-core/core/dbt/dbt_ibis/_dbt_ibis.py Lines 1 to 28 in 158aa81
the badit's slow! very slow. a run is now taking closer than 5 seconds, up from 1-2. I don't know why. I made a lazy attempt to make it better |
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
Although we are closing this PR as stale, it can still be reopened to continue development. Just add a comment to notify the maintainers. |
In case anyone lands here looking for an integration of dbt and ibis, you might be interested in dbt-ibis. |
resolves nothing
Description
this is basically #5982 but using
.ibis
as the extensionrunning dbt Python models is a bit slow -- SQL cheats. what if we could cheat with Python too?
Ibis provides a full-features replacement for SQL
SELECT
queries with Python code. this offers benefits like the flexibility of Python, reuse of expressions, type checking, and morewith some adapatations to the PRQL PR, I was able to get this working (at least in simple cases) for Ibis. this brings down the time to run a simple Python model from ~7-20s to ~1-2s on Snowflake
rough steps to reproduce:
you'd need to edit
dbt-core/core/dbt/parser/_dbt_ibis.py
to adjust the hardcoded stuff. thecore/dbt/parser/_dbt_ibis.py
code is unfathomably ugly:it's hardcoded -- I couldn't figure out the best way to get the profile/adapter credentials into the parser here. I'll ask internally.
beyond that, I could not figure out a good way to execute the ibis code. unfortunately, we do need to make a connection for ibis to read metadata from the tables and compile its expressions down into SQL. I used an
exec
intoeval
, which I'm not proud ofthis doesn't work on some more complicated ibis expressions that generates
"%(param_9)s"
in the compiled strings -- not sure why but I expect due to the hackiness of the above, as the same code works fine normally in ibisan example of a model that results in that, based off the newer https://github.com/dbt-labs/dbt-demo-data, is:
resulting in this traceback:
from this compiled code:
Checklist
changie new
to create a changelog entry