MCPcopy
hub / github.com/pathwaycom/pathway / test_json_get_wrong_default

Function test_json_get_wrong_default

python/pathway/tests/test_json.py:177–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176
177def test_json_get_wrong_default():
178 input = _json_table(
179 data=[
180 {"a": {"b": 1}},
181 ]
182 )
183
184 with pytest.raises(
185 TypeError,
186 match=re.escape(rf"Default must be of type {pw.Json | None}, found {int}."),
187 ):
188 input.select(result=pw.this.data.get("a", 42).get("b"))
189
190
191def test_json_get_item():

Callers

nothing calls this directly

Calls 3

_json_tableFunction · 0.85
selectMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected