Skip to content

fix(sql): export the SingleStoreDB compiler module - #12164

Merged
deepyaman merged 1 commit into
ibis-project:mainfrom
deepyaman:fix/export-singlestoredb-compiler
Oct 13, 2026
Merged

deepyaman merged 1 commit into
ibis-project:mainfrom
deepyaman:fix/export-singlestoredb-compiler

Conversation

@deepyaman

Copy link
Copy Markdown
Collaborator

Description of changes

ibis.to_sql looks a dialect name up as an attribute of ibis.backends.sql.compilers, but that package never imported the singlestoredb compiler module. So ibis.to_sql(expr, dialect="singlestoredb") raised ValueError: Unknown dialect singlestoredb unless something had imported ibis.backends.singlestoredb first. Our backend test jobs always import the backend, which is why CI never caught it.

This imports the module and adds SingleStoreDBCompiler to __all__, matching every other SQL backend. The new test compiles a trivial table for each SQL backend name, so a future backend that misses this list fails in the core test job.

Found while moving compile-only tests around in #12153.

🤖 Generated with Claude Code

`ibis.to_sql` resolves a dialect name by attribute lookup on
`ibis.backends.sql.compilers`, which never imported the `singlestoredb`
module. `ibis.to_sql(expr, dialect="singlestoredb")` therefore raised
"Unknown dialect" unless the backend had already been imported.

Add a test that compiles a trivial table for every SQL backend name.

Assisted-by: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added tests Issues or PRs related to tests sql Backends that generate SQL labels Oct 13, 2026
# `ibis.to_sql` looks the dialect up on `ibis.backends.sql.compilers`, so
# every SQL backend's compiler module has to be imported there
expr = ibis.table({"a": "int64"}, name="t")
assert ibis.to_sql(expr, dialect=dialect)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude Why is this an assert? Is the idea that we're happy as long as some non-empty SQL is produced (and there's no error along the way)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yesh I think this should be a little more strict, eg even a very basicassert "from" in sql

@deepyaman
deepyaman requested a review from NickCrews October 13, 2026 22:39

@NickCrews NickCrews left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty inoffensive and a move in the right direction! I don't really care that much about the comment thread and would be happy with pretty much anything.

# `ibis.to_sql` looks the dialect up on `ibis.backends.sql.compilers`, so
# every SQL backend's compiler module has to be imported there
expr = ibis.table({"a": "int64"}, name="t")
assert ibis.to_sql(expr, dialect=dialect)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yesh I think this should be a little more strict, eg even a very basicassert "from" in sql

@deepyaman

Copy link
Copy Markdown
Collaborator Author

Looks pretty inoffensive and a move in the right direction! I don't really care that much about the comment thread and would be happy with pretty much anything.

Sounds good; I'll just leave it rather than worrying about "from" capitalization or waiting for another round of CI. :) Also, since have another PR which vendored this fix.

@deepyaman
deepyaman merged commit bcb1014 into ibis-project:main Oct 13, 2026
83 checks passed
@deepyaman
deepyaman deleted the fix/export-singlestoredb-compiler branch October 13, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql Backends that generate SQL tests Issues or PRs related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants