git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pass execution date as a datetime object to MongoToS3Operator


Hi,

I'm having an issue where I want to pass the dags execution_date to the
query parameter in the MongoToS3Operator via templating. The templating
works properly, however, it appears that pymongo will only filter date
fields when passed a datetime object, and while the underlying object in
the template '{{ execution_date }}' is a datetime object once rendered it
is only a string thus MongoToS3Operator is unable to filter. Furthermore, I
cannot parse a template to a datetime object since dags are processed by
the scheduler at a configured interval resulting in an error. Is there a
way around this that I don't know about or am overlooking?

-- 
Kyle Hamlin