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

Better error messages on inserts (ProgrammingError for invalid types) #229

Closed
carterjfulcher opened this issue Aug 4, 2023 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@carterjfulcher
Copy link

carterjfulcher commented Aug 4, 2023

I'm inserting a large data frame, with over a million rows. The following error is raised:

raise ProgrammingError('Internal serialization error.  This usually indicates invalid data types ' +
clickhouse_connect.driver.exceptions.ProgrammingError: Internal serialization error.  This usually indicates invalid data types in an inserted row or column

This error is not falsely triggered, it just doesn't provide any useful information towards debugging the error. I don't know which column has this type error, much less which row.

Edit: This may not be possible to fix without an upstream Clickhouse API modification.

From source (driver/httpclient.py)

    def error_handler(response: HTTPResponse):
            # If we actually had a local exception when building the insert, throw that instead
            if context.insert_exception:
                ex = context.insert_exception
                context.insert_exception = None
                raise ProgrammingError('Internal serialization error.  This usually indicates invalid data types ' +
                                       'in an inserted row or column') from ex  # type: ignore
            self._error_handler(response)
@carterjfulcher carterjfulcher added the enhancement New feature or request label Aug 4, 2023
@carterjfulcher carterjfulcher changed the title Better error messages on inserts (ProgrammingError for invalid types) Better error messages on inserts (ProgrammingError for invalid types) Aug 4, 2023
@genzgd
Copy link
Collaborator

genzgd commented Aug 4, 2023

You should have the full stack trace in your logs, which can provide a clue?

@genzgd genzgd mentioned this issue Aug 21, 2023
2 tasks
@genzgd
Copy link
Collaborator

genzgd commented Aug 22, 2023

Column name and full stack trace should be available for these kinds of errors starting with v0.6.9. Because of the way that columns are generated, it's normally not possible to determine what particular row in the column insert would have caused the exception, so that level of debugging information will not normally be available.

@genzgd genzgd closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants