Gary Sieling

RethinkDB filter for the absence of a column in python

The following query will find rows that don’t have a given column. This is useful in ETL scenarios, where you are incrementally augmenting data with additional columns.

This is slightly tricky to figure out, because this is “has_fields” in python, and “hasFields” in ReQL, and “not_” in python, as “not” is a reserved word.

print table.filter(r.row.has_fields("Title_Query_Distance").not_()).count().run()
Exit mobile version