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)
| 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. |