Updates columns of `self`, according to args and kwargs. See `table.select` specification for evaluation of args and kwargs. Example: >>> import pathway as pw >>> t1 = pw.debug.table_from_markdown(''' ... | age | owner | pet ... 1 | 10 | Alice | 1
(self, *args: expr.ColumnReference, **kwargs: Any)
| 1863 | @trace_user_frame |
| 1864 | @desugar |
| 1865 | def with_columns(self, *args: expr.ColumnReference, **kwargs: Any) -> Table: |
| 1866 | """Updates columns of `self`, according to args and kwargs. |
| 1867 | See `table.select` specification for evaluation of args and kwargs. |
| 1868 | |
| 1869 | Example: |
| 1870 | |
| 1871 | >>> import pathway as pw |
| 1872 | >>> t1 = pw.debug.table_from_markdown(''' |
| 1873 | ... | age | owner | pet |
| 1874 | ... 1 | 10 | Alice | 1 |
| 1875 | ... 2 | 9 | Bob | 1 |
| 1876 | ... 3 | 8 | Alice | 2 |
| 1877 | ... ''') |
| 1878 | >>> t2 = pw.debug.table_from_markdown(''' |
| 1879 | ... | owner | pet | size |
| 1880 | ... 1 | Tom | 1 | 10 |
| 1881 | ... 2 | Bob | 1 | 9 |
| 1882 | ... 3 | Tom | 2 | 8 |
| 1883 | ... ''') |
| 1884 | >>> t3 = t1.with_columns(*t2) |
| 1885 | >>> pw.debug.compute_and_print(t3, include_id=False) |
| 1886 | age | owner | pet | size |
| 1887 | 8 | Tom | 2 | 8 |
| 1888 | 9 | Bob | 1 | 9 |
| 1889 | 10 | Tom | 1 | 10 |
| 1890 | """ |
| 1891 | other = self.select(*args, **kwargs) |
| 1892 | columns = dict(self) |
| 1893 | columns.update(other) |
| 1894 | return self.select(**columns) |
| 1895 | |
| 1896 | @trace_user_frame |
| 1897 | @desugar |