MCPcopy Index your code
hub / github.com/pathwaycom/pathway / _optional

Function _optional

python/pathway/stdlib/utils/col.py:137–144  ·  view source on GitHub ↗
(
            col: pw.ColumnExpression,
            op: Callable[[pw.ColumnExpression], pw.ColumnExpression],
        )

Source from the content-addressed store, hash-verified

135 result: pw.ColumnExpression
136
137 def _optional(
138 col: pw.ColumnExpression,
139 op: Callable[[pw.ColumnExpression], pw.ColumnExpression],
140 ) -> pw.ColumnExpression:
141 if is_optional:
142 return pw.if_else(col == pw.Json.NULL, None, op(col))
143 else:
144 return op(col)
145
146 match _type:
147 case dt.JSON:

Callers 1

_convert_from_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected