Selects all columns without named column references. Args: columns: columns to be dropped provided by `table.column_name` notation. Returns: Table: `self` without specified columns. Example: >>> import pathway as pw >>> t1 = pw.debu
(self, *columns: str | expr.ColumnReference)
| 2171 | @contextualized_operator |
| 2172 | @check_arg_types |
| 2173 | def without(self, *columns: str | expr.ColumnReference) -> Table: |
| 2174 | """Selects all columns without named column references. |
| 2175 | |
| 2176 | Args: |
| 2177 | columns: columns to be dropped provided by `table.column_name` notation. |
| 2178 | |
| 2179 | Returns: |
| 2180 | Table: `self` without specified columns. |
| 2181 | |
| 2182 | Example: |
| 2183 | |
| 2184 | >>> import pathway as pw |
| 2185 | >>> t1 = pw.debug.table_from_markdown(''' |
| 2186 | ... age | owner | pet |
| 2187 | ... 10 | Alice | 1 |
| 2188 | ... 9 | Bob | 1 |
| 2189 | ... 8 | Alice | 2 |
| 2190 | ... ''') |
| 2191 | >>> t2 = t1.without(t1.age, pw.this.pet) |
| 2192 | >>> pw.debug.compute_and_print(t2, include_id=False) |
| 2193 | owner |
| 2194 | Alice |
| 2195 | Alice |
| 2196 | Bob |
| 2197 | """ |
| 2198 | new_columns = self._columns.copy() |
| 2199 | for col in columns: |
| 2200 | if isinstance(col, expr.ColumnReference): |
| 2201 | new_columns.pop(col.name) |
| 2202 | else: |
| 2203 | assert isinstance(col, str) |
| 2204 | new_columns.pop(col) |
| 2205 | columns_wrapped = { |
| 2206 | name: self._wrap_column_in_context(self._rowwise_context, column, name) |
| 2207 | for name, column in new_columns.items() |
| 2208 | } |
| 2209 | return self._with_same_universe(*columns_wrapped.items()) |
| 2210 | |
| 2211 | @trace_user_frame |
| 2212 | @contextualized_operator |