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

Function _optional_json_table

python/pathway/tests/test_json.py:53–62  ·  view source on GitHub ↗
(**kwargs)

Source from the content-addressed store, hash-verified

51
52
53def _optional_json_table(**kwargs) -> pw.Table:
54 @pw.udf
55 def filter_null(col: pw.Json) -> pw.Json | None:
56 if col == pw.Json(None):
57 return None
58 return col
59
60 table = _json_table(**kwargs)
61
62 return table.select(**{name: filter_null(pw.this[name]) for name in kwargs})
63
64
65def test_json_get_simple():

Callers 1

test_json_get_simpleFunction · 0.85

Calls 3

_json_tableFunction · 0.85
filter_nullFunction · 0.85
selectMethod · 0.45

Tested by

no test coverage detected