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

DuckDB relation failing as Python model return type #473

Open
Soloniss opened this issue Oct 31, 2024 · 1 comment
Open

DuckDB relation failing as Python model return type #473

Soloniss opened this issue Oct 31, 2024 · 1 comment

Comments

@Soloniss
Copy link

When returning a DuckDB relation as a return type for my python model I get an error stating that the dataframe cannot be found

Catalog Error: Table with name df does not exist! Did you mean "pg_depend"? LINE 1: ... my_transform__dbt_tmp" as select * from df 

However, after converting the relation to a pandas dataframe or arrow table, things work as expected. My assumption is there's something wrong with the DuckDB connection which closes the relation, or the relation being out of scope. Any tips here?

@jwills
Copy link
Collaborator

jwills commented Nov 11, 2024

Hey @Soloniss, apologies for the lag here-- I tried to play with this a bit and I couldn't reproduce it locally, but then I promptly got busy with some non-DuckDB work stuff and forgot to post about it. Is there any easy way to repro this that you've come across? I have a couple of functional tests that exercise variations of the scenario you described and they all work AFAICT, but if I've missed something I would very much like to fix it: https://github.com/duckdb/dbt-duckdb/blob/master/tests/functional/adapter/test_python_model.py#L116

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

No branches or pull requests

2 participants