Is there a better and fast way to check user input beside IF satatement?

@asehmi I love your filtering framework, reminds me of this flask video!

In this case adding another clause to asehmi’s build_query() would fit the fuzzy search / LIKE % % requirement:

        elif v['dtype'] == str:
            query_frag = f"{v['db_col']}.str.contains('{v['dtype'](v['value'])}')"

(might need to change to df.query(query, engine='python'), see docs)

Or using a similar technique to build a pyodbc query might be more comfortable for you

1 Like