in data_validation/query_builder/query_builder.py [0:0]
def compile(self, ibis_table):
# Fields are supplied on compile or on build
group_field = ibis_table[self.field_name]
# TODO: generate cast for known types not specified
if self.cast:
group_field = group_field.cast(self.cast)
elif isinstance(group_field.type(), ibis.expr.datatypes.Timestamp):
group_field = group_field.cast("date")
else:
# TODO: need to build Truncation Int support
# TODO: should be using a logger
logging.warning("Unknown cast types can cause memory errors")
# The Casts require we also supply a name.
alias = self.alias or self.field_name
group_field = group_field.name(alias)
return group_field