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

Function test_json_array_get_str_index

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

Source from the content-addressed store, hash-verified

155
156
157def test_json_array_get_str_index():
158 input = _json_table(
159 data=[
160 {"a": [1, 2, 3]},
161 ]
162 )
163
164 result = input.select(result=pw.this.data["a"].get("foo"))
165
166 assert_table_equality(
167 T(
168 """
169 | result
170 1 |
171 """
172 ).update_types(result=Optional[pw.Json]),
173 result,
174 )
175
176
177def test_json_get_wrong_default():

Callers

nothing calls this directly

Calls 5

TFunction · 0.90
_json_tableFunction · 0.85
update_typesMethod · 0.80
selectMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected