Skip to content

Commit

Permalink
Fix Array column null defauls #339
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Nov 5, 2022
1 parent 57ad361 commit 087d6c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clickhouse_driver/columns/arraycolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, nested_column, **kwargs):
self.nested_column = nested_column
self._write_depth_0_size = True
super(ArrayColumn, self).__init__(**kwargs)
self.null_value = [nested_column.null_value]
self.null_value = []

def write_data(self, data, buf):
# Column of Array(T) is stored in "compact" format and passed to server
Expand Down
4 changes: 2 additions & 2 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ class InputFormatNullTestCase(BaseTestCase):
('a Int8, b String', [(None, None)], [(0, '')], '0\t\n'),
('a LowCardinality(String)', [(None, )], [('', )], '\n'),
('a Tuple(Int32, Int32)', [(None,)], [((0, 0), )], '(0,0)\n'),
('a Array(Array(Int32))', [(None,)], [([[0]],)], '[[0]]\n'),
('a Array(Array(Int32))', [(None,)], [([],)], '[]\n'),
('a Map(String, UInt64)', [(None,)], [({},)], '{}\n'),
('a Nested(i Int32)', [(None, )], [([0], )], '[0]\n')
('a Nested(i Int32)', [(None, )], [([], )], '[]\n')
])
def test_input_format_null_as_default(self, spec, data, res, cli_res):
client_settings = {'input_format_null_as_default': True}
Expand Down

0 comments on commit 087d6c9

Please sign in to comment.