datahq / dataflows

DataFlows is a simple, intuitive lightweight framework for building data processing flows in python.
https://dataflows.org
MIT License
194 stars 39 forks source link

Add filter rows with callable #71

Open akariv opened 5 years ago

akariv commented 5 years ago

Filter rows using a callable in Python's built in filter. This is very useful and can be reused. It might make sense to merge with dataflows.filter_rows. h/t @shevron

def filter_rows_callable(cb):
    def f(rows):
        yield from filter(cb, rows)
    return f