Better handling of unsupported types in args#34
Draft
mdbenito wants to merge 5 commits into
Draft
Conversation
mdbenito
commented
Jun 25, 2026
| if not self._is_python_scan_object(value): | ||
| msg = ( | ||
| "Binder exception: Trying to scan from unsupported data type " | ||
| "INT8[]. The only parameter types that can be scanned from " |
Contributor
Author
There was a problem hiding this comment.
This looked like a typo
mdbenito
commented
Jun 25, 2026
| def _maybe_raise_scan_unsupported_object(query: str) -> None: | ||
| match = re.search( | ||
| r"\bLOAD\s+FROM\s+([A-Za-z_][A-Za-z0-9_]*)\b", query, re.IGNORECASE | ||
| r"\b(LOAD|COPY)\b.*?\bFROM\s+([A-Za-z_][A-Za-z0-9_]*)\b", |
Contributor
Author
There was a problem hiding this comment.
The regex should catch all of LOAD, LOAD WITH... and COPY FROM
Contributor
|
The regexes could be replaced to use something like this in C-API: https://github.com/LadybugDB/ladybug/blob/main/src/c_api/prepared_statement.cpp#L37-L39 That's preferable to using because of the maintenance cost (every time the grammar changes, we need to generate bindings) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passing a dataframe / arrow table to any non-scanning clause (LOAD/COPY FROM) results in lb dying in
UNREACHABLE_CODEbecause we hit the end of a switch without handlingLogicalTypeId::POINTER, which is whatpyLogicalTypemaps dfs to, but only forLOAD / COPY ... FROMscan replacement.This is not a big deal, but I think it's nicer to have an informative error
This PR:
LOAD WITH HEADERS.