I had an issue in pipeline algorithm that I would like to get the latest asof_date can do come comparison with a fixed date (e.g. today the simulation date) to create a filter. However I do not know a good way to do it.
For example:
from quantopian.pipeline.data.zacks import EarningsSurprises
def make_pipeline(context):
earn_date = EarningsSurprises.asof_date.latest
sim_date = get_datetime().date()
# create a filter to see if earning date is the same as sim_date
date_filter = earn_date.eq(sim_date)
....
This will result in error like:
BadBinaryOperator: Can't compute Latest == date
There was a runtime error on line xxx.
My question is: since the asof_date is not a simple float, the earn_date (which comes from .latest attribute) is not a factor either?
and how could I build a filter from comparing the asof_date.latest with some datetime objects?
Appreciate the help. Thanks much.