dbt-selly/dbt-env/lib/python3.8/site-packages/agate/aggregations/has_nulls.py

22 lines
508 B
Python
Raw Normal View History

2022-03-22 15:13:27 +00:00
#!/usr/bin/env python
from agate.aggregations.base import Aggregation
from agate.data_types import Boolean
class HasNulls(Aggregation):
"""
Check if the column contains null values.
:param column_name:
The name of the column to check.
"""
def __init__(self, column_name):
self._column_name = column_name
def get_aggregate_data_type(self, table):
return Boolean()
def run(self, table):
return None in table.columns[self._column_name].values()