MCPcopy
hub / github.com/uber/petastorm / test_encode_scalar_bool

Function test_encode_scalar_bool

petastorm/tests/test_codec_scalar.py:82–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81
82def test_encode_scalar_bool():
83 codec = ScalarCodec(BooleanType())
84 field = UnischemaField(name='field_bool', numpy_dtype=np.bool, shape=(), codec=codec, nullable=False)
85
86 encoded = codec.encode(field, np.bool_(True))
87 assert isinstance(codec.encode(field, encoded), bool)
88 assert encoded
89
90 encoded = codec.encode(field, np.bool_(False))
91 assert not encoded
92
93
94def test_encode_scalar_int():

Callers

nothing calls this directly

Calls 3

encodeMethod · 0.95
ScalarCodecClass · 0.90
UnischemaFieldClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…