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

[improvement] Better error messages #207

Open
halilduygulu opened this issue Apr 7, 2021 · 1 comment
Open

[improvement] Better error messages #207

halilduygulu opened this issue Apr 7, 2021 · 1 comment

Comments

@halilduygulu
Copy link

Hi, thanks for this library.
I recently started using and I struggled with this kind of error messages.
Is it possible to pinpoint the error messages to related column name more? Of course I see most error messages have columnnames inside but this one below, I spent a lot of time to find 1 column causing this in a 40+ column table.

[ERROR] AttributeError: 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
  File "/var/task/serverless_sdk/__init__.py", line 144, in wrapped_handler
    return user_handler(event, context)
  File "/var/task/sqs_process.py", line 65, in ingest_events
    types_check = False
  File "/var/task/clickhouse_driver/client.py", line 245, in execute
    columnar=columnar
  File "/var/task/clickhouse_driver/client.py", line 472, in process_insert_query
    types_check=types_check, columnar=columnar)
  File "/var/task/clickhouse_driver/client.py", line 524, in send_data
    self.connection.send_data(block)
  File "/var/task/clickhouse_driver/connection.py", line 554, in send_data
    self.block_out.write(block)
  File "/var/task/clickhouse_driver/streams/native.py", line 39, in write
    self.fout, types_check=block.types_check)
  File "/var/task/clickhouse_driver/columns/service.py", line 107, in write_column
    column.write_data(items, buf)
  File "/var/task/clickhouse_driver/columns/base.py", line 77, in write_data
    self._write_data(items, buf)
  File "/var/task/clickhouse_driver/columns/base.py", line 81, in _write_data
    self.write_items(prepared, buf)
  File "/var/task/clickhouse_driver/columns/stringcolumn.py", line 19, in write_items
    buf.write_strings(items, encoding=self.encoding)
  File "clickhouse_driver/bufferedwriter.pyx", line 54, in clickhouse_driver.bufferedwriter.BufferedWriter.write_strings
@WesleyBatista
Copy link

for those looking for the solution: compare the table structure with show create mytable and the data you are sending.

in my case for example it was a column of type String but I was sending a None value. ensuring you are sending an empty string instead of None or changing column type to Nullable(String) solves it.

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

2 participants