-
Notifications
You must be signed in to change notification settings - Fork 54
Allow overriding the date from the DagRun conf #880
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, though, what is this date used for? It's not totally clear to me.
Is there a place where we can find these configuration parameters with their descriptions or use cases documented? Yesterday I was looking to limit the number of records pulled, and I wasn't sure if there is a param for it (there is an Airflow Variable but something for an individual DAG run? would be nice to add it if it's not already done).
This is the ingestion (A recent use case for me was testing with Finnish Museums. I wanted to reproduce a bug that only happens on certain days, and found it useful to be able to easily kick off ingestion for specific dates.)
There isn't, but there is an issue to add documentation! WordPress/openverse#1427 Couldn't agree more, it's easy to forget what the available options are.
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! I can't test this locally at this time, but the implementation & test look 💯
Finally able to test, works great! |
Fixes
Description
Adds an option to the DagRun conf to let you override the
date
of a run of a dated provider DAG.When you manually run a dated DAG, it is always passed in today's date. This option allows you to pass in any arbitrary date you'd like. While I don't necessarily expect this to be used frequently in production, it has come in handy many times for local testing.
Testing Instructions
To trigger a DAG using a date override, select the
Trigger DAG w/ config
option seen here:Then pass your chosen date in using a
YYYY-MM-DD
format like this:{"date": "2022-04-10"}
Pick a dated DAG, like Europeana:
Using date <date> from dagrun conf.
Notes
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin