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

Method without

python/pathway/internals/table.py:2173–2209  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 15

merge_filtersMethod · 0.45
_selectFunction · 0.45
_pandas_transformerFunction · 0.45
successfulMethod · 0.45
failedMethod · 0.45
multiapply_all_rowsFunction · 0.45
inactivity_detectionFunction · 0.45
add_update_timestamp_utcFunction · 0.45
selectMethod · 0.45
queryMethod · 0.45
_repack_resultsMethod · 0.45
_propose_clustersFunction · 0.45

Calls 4

_with_same_universeMethod · 0.95
itemsMethod · 0.80
copyMethod · 0.45

Tested by 15

test_custom_mean_stdevFunction · 0.36
_json_table_from_listFunction · 0.36
test_json_as_typeFunction · 0.36
test_json_udf_as_typeFunction · 0.36
test_drop_columnsFunction · 0.36
test_wildcard_shadowingFunction · 0.36
test_this_magic_1Function · 0.36
test_this_magic_2Function · 0.36
test_this_magic_3Function · 0.36
test_this_magic_4Function · 0.36
test_slices_3Function · 0.36