You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by Kyle Hamlin <ha...@gmail.com> on 2018/10/22 18:40:28 UTC

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