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

[Bug]: Long column names are truncated #910

Open
1 task done
cpcloud opened this issue Feb 20, 2024 · 3 comments
Open
1 task done

[Bug]: Long column names are truncated #910

cpcloud opened this issue Feb 20, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cpcloud
Copy link
Contributor

cpcloud commented Feb 20, 2024

What happened?

Observed in ibis-project/ibis#8393.

Long column names appear to be truncated when using duckdb_engine to fetch results.

Reproducible example:

import sqlalchemy as sa

long_name = "a_very_very_very_very_very_very_very_very_very_long_column_name"

eng = sa.create_engine("duckdb:///test.db")

with eng.begin() as con:
    con.exec_driver_sql(f"CREATE OR REPLACE TABLE t ({long_name} INT)")

t = sa.Table("t", sa.MetaData(), autoload_with=eng)
t1 = sa.select(t.c[0]).select_from(t).subquery()
query = sa.select(t1.c[long_name])

with eng.begin() as con:
    result = con.execute(query)
    batch = result.connection.connection.fetch_record_batch()

assert batch.schema.names[0] == long_name, batch.schema.names[0]

DuckDB Engine Version

0.10.0

DuckDB Version

0.9.2, 0.10.0

SQLAlchemy Version

1.4.51

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Mause
Copy link
Owner

Mause commented Feb 20, 2024

@cpcloud
Copy link
Contributor Author

cpcloud commented Feb 20, 2024

I wonder if this is another nail in the coffin for subclassing from that dialect.

In the next Ibis release we're moving away from SQLAlchemy entirely to avoid the extra layer and myriad dependencies (which Ibis already has plenty of!).

duckdb_engine has been great to work with!

@Mause
Copy link
Owner

Mause commented Feb 20, 2024

Given that it's in the "base" Postgres dialect, rather than the psycopg2 one, I'm not sure it is

I saw in the linked issue, congrats!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants