• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mymarilyn / clickhouse-driver / 5064204980

pending completion
5064204980

Pull #379

github

GitHub
Merge 5b25ab3a4 into 18f28c633
Pull Request #379: Enable hostname verification with verify option

0 of 1 new or added line in 1 file covered. (0.0%)

462 existing lines in 18 files now uncovered.

3402 of 4007 relevant lines covered (84.9%)

39.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/clickhouse_driver/columns/numpy/stringcolumn.py
1
import numpy as np
2

UNCOV
3
from ... import defines
×
UNCOV
4
from .base import NumpyColumn
×
5

6

UNCOV
7
class NumpyStringColumn(NumpyColumn):
×
UNCOV
8
    null_value = ''
×
9

UNCOV
10
    default_encoding = defines.STRINGS_ENCODING
×
11

UNCOV
12
    def __init__(self, encoding=default_encoding, **kwargs):
×
UNCOV
13
        self.encoding = encoding
×
UNCOV
14
        super(NumpyStringColumn, self).__init__(**kwargs)
×
15

UNCOV
16
    def read_items(self, n_items, buf):
×
UNCOV
17
        return np.array(
×
18
            buf.read_strings(n_items, encoding=self.encoding), dtype=self.dtype
19
        )
20

UNCOV
21
    def write_items(self, items, buf):
×
UNCOV
22
        return buf.write_strings(items.tolist(), encoding=self.encoding)
×
23

24

UNCOV
25
class NumpyByteStringColumn(NumpyColumn):
×
UNCOV
26
    null_value = b''
×
27

UNCOV
28
    def read_items(self, n_items, buf):
×
UNCOV
29
        return np.array(buf.read_strings(n_items), dtype=self.dtype)
×
30

UNCOV
31
    def write_items(self, items, buf):
×
UNCOV
32
        return buf.write_strings(items.tolist())
×
33

34

UNCOV
35
class NumpyFixedString(NumpyStringColumn):
×
UNCOV
36
    def __init__(self, length, **kwargs):
×
UNCOV
37
        self.length = length
×
UNCOV
38
        super(NumpyFixedString, self).__init__(**kwargs)
×
39

UNCOV
40
    def read_items(self, n_items, buf):
×
UNCOV
41
        return np.array(buf.read_fixed_strings(
×
42
            n_items, self.length, encoding=self.encoding
43
        ), dtype=self.dtype)
44

UNCOV
45
    def write_items(self, items, buf):
×
UNCOV
46
        return buf.write_fixed_strings(
×
47
            items.tolist(), self.length, encoding=self.encoding
48
        )
49

50

UNCOV
51
class NumpyByteFixedString(NumpyByteStringColumn):
×
UNCOV
52
    def __init__(self, length, **kwargs):
×
UNCOV
53
        self.length = length
×
UNCOV
54
        super(NumpyByteFixedString, self).__init__(**kwargs)
×
55

UNCOV
56
    def read_items(self, n_items, buf):
×
UNCOV
57
        return np.array(
×
58
            buf.read_fixed_strings(n_items, self.length), dtype=self.dtype
59
        )
60

UNCOV
61
    def write_items(self, items, buf):
×
UNCOV
62
        return buf.write_fixed_strings(items.tolist(), self.length)
×
63

64

UNCOV
65
def create_string_column(spec, column_options):
×
UNCOV
66
    client_settings = column_options['context'].client_settings
×
UNCOV
67
    strings_as_bytes = client_settings['strings_as_bytes']
×
UNCOV
68
    encoding = client_settings.get(
×
69
        'strings_encoding', NumpyStringColumn.default_encoding
70
    )
71

UNCOV
72
    if spec == 'String':
×
UNCOV
73
        cls = NumpyByteStringColumn if strings_as_bytes else NumpyStringColumn
×
UNCOV
74
        return cls(encoding=encoding, **column_options)
×
75
    else:
UNCOV
76
        length = int(spec[12:-1])
×
UNCOV
77
        cls = NumpyByteFixedString if strings_as_bytes else NumpyFixedString
×
UNCOV
78
        return cls(length, encoding=encoding, **column_options)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc