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

output too verbose when running non-select SQL statements #686

Closed
edublancas opened this issue Jun 28, 2023 · 0 comments
Closed

output too verbose when running non-select SQL statements #686

edublancas opened this issue Jun 28, 2023 · 0 comments

Comments

@edublancas
Copy link

In #655, we added a message at the bottom of ResultSet, so users knew that the returned value is not a data frame. However, since all SQL statements return ResultSet, even statements such as CREATE TABLE will return a ResultSet, hence the new label (see here: #655 (review))

It's rarely the case that someone will want to convert the result of a create table statement into a pandas dataframe so it'd be better not to show the label to clean things up.

I don't know what's the most reliable approach, perhaps we can add a flag to hide this when the ResultSet was not generated from a SELECT statement? However, in DuckDB SELECT * FROM table is the same as FROM table, and a CTE like:

with something as (
    select * from stuff
)
select * from something

is another possibility. So I'm unsure if there's a reliable way to detect SELECT and SELECT-like statements.

Perhaps we can infer this from the sqlalchemy cursor that returns the results? i.e., if there's only one result and the column is named Count, we don't show the info. But then we have to think, what do we do with UPDATE statements and others that might return the same or similar results?

@edublancas edublancas closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2023
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

1 participant