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

dataframe is not recognized as input in Colab #4723

Open
danielsparing opened this issue Feb 6, 2025 · 2 comments
Open

dataframe is not recognized as input in Colab #4723

danielsparing opened this issue Feb 6, 2025 · 2 comments
Assignees

Comments

@danielsparing
Copy link

The Colab version linked from the Jupyter Notebooks example currently fails at:

%sql output_df << SELECT sum(i) as total_i FROM input_df
output_df
# Returns:
# RuntimeError: If using snippets, you may pass the --with argument explicitly.
# For more details please refer: https://jupysql.ploomber.io/en/latest/compose.html#with-argument
# 
# 
# Original error message from DB driver:
# (duckdb.duckdb.CatalogException) Catalog Error: Table with name input_df does not exist!
D# id you mean "pg_attrdef"?
# 
# LINE 1: SELECT sum(i) as total_i FROM input_df
#                                       ^
# [SQL: SELECT sum(i) as total_i FROM input_df]
# (Background on this error at: https://sqlalche.me/e/20/f405)
# 
# If you need help solving this issue, send us a message: https://ploomber.io/community
@danielsparing
Copy link
Author

danielsparing commented Feb 6, 2025

Some more details:

This seems to only happen with SQLAlchemy. If I replace %sql duckdb:///:memory: with:

conn = duckdb.connect()
%sql conn --alias duckdb

, then it works1.

Footnotes

  1. well, it then runs into https://github.com/ploomber/jupysql/issues/1038 which is already fixed in the latest release, so it works if I remove the version pinning !pip install --quiet jupysql # ==0.10.12. But maybe that was there for a reason? :) And in general, SQLAlchemy was avoided for a reason?

@danielsparing
Copy link
Author

fyi I also wrote up a similar but different issue.

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