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

Method is_not_none

python/pathway/internals/expression.py:301–320  ·  view source on GitHub ↗

Returns true if the value is not None. Example: >>> import pathway as pw >>> t1 = pw.debug.table_from_markdown(''' ... | owner | pet ... 1 | Alice | dog ... 2 | Bob | ... 3 | Carol | cat ... ''') >>> t2 = t1.with_columns(h

(self)

Source from the content-addressed store, hash-verified

299 return IsNoneExpression(self)
300
301 def is_not_none(self) -> IsNotNoneExpression:
302 """Returns true if the value is not None.
303
304 Example:
305
306 >>> import pathway as pw
307 >>> t1 = pw.debug.table_from_markdown('''
308 ... | owner | pet
309 ... 1 | Alice | dog
310 ... 2 | Bob |
311 ... 3 | Carol | cat
312 ... ''')
313 >>> t2 = t1.with_columns(has_pet=pw.this.pet.is_not_none())
314 >>> pw.debug.compute_and_print(t2, include_id=False)
315 owner | pet | has_pet
316 Alice | dog | True
317 Bob | | False
318 Carol | cat | True
319 """
320 return IsNotNoneExpression(self)
321
322 # Missing `__iter__` would make Python fall back to `__getitem__, which
323 # will not do the right thing.

Callers 15

build_pipelineMethod · 0.80
_compute_group_reprMethod · 0.80
fill_peerMethod · 0.80
get_differencesFunction · 0.80
test_join_ixFunction · 0.80
test_multiple_ixFunction · 0.80
test_outerjoin_filter_1Function · 0.80
test_outerjoin_filter_2Function · 0.80
test_unwrapFunction · 0.80
logicFunction · 0.80
test_ix_optionalFunction · 0.80

Calls 1

IsNotNoneExpressionClass · 0.85

Tested by 11

get_differencesFunction · 0.64
test_join_ixFunction · 0.64
test_multiple_ixFunction · 0.64
test_outerjoin_filter_1Function · 0.64
test_outerjoin_filter_2Function · 0.64
test_unwrapFunction · 0.64
logicFunction · 0.64
test_ix_optionalFunction · 0.64