If you were to attach a `pipe` filter `step` to a ...
# hamilton-help
s
If you were to attach a
pipe
filter
step
to a node, could this
with_filter_criteria
node be accessed from the driver? E.g.
Copy code
def _filter_criteria(df: pd.DataFrame, col: str) -> pd.DataFrame:
    return df[df[col] == "US"]

@pipe(step(_filter_criteria, col="region"))
def filtered_data(raw_data: pd.DataFrame) -> pd.DataFrame:
    # some work with raw_data
Pardon.... just had to change
Copy code
dr.execute(["with_filter_criteria"])
to
Copy code
dr.execute(["filtered_data.with_filter_criteria"])
🙌 1
btw do you know if
pipe
filter steps automatically reset the index? I know previously when having intermediate filtered nodes, that if i didnt include
df.reset_index(drop=True)
it would cause issues.
e
Nice! Yep, exactly. So they do what your function does — shohldnt be automatically resetting it.
👍 1