def _check_datetime_field(name, measure):
    if not isinstance(measure[name], (Date, DateTime)):
        raise TypeError(
            "'{name}' field must be a '{dt}', not: '{dshape}'".format(
                name=name,
                dt=DateTime(),
                dshape=measure[name],
            ),
        )
Check that a field is a datetime inside some measure.
dataset/ETHPy150Open quantopian/zipline/zipline/pipeline/loaders/blaze/core.py/_check_datetime_field