airflow-plugins / airflow_api_plugin Goto Github PK
View Code? Open in Web Editor NEWREST-like API exposing Airflow data and operations
License: Apache License 2.0
REST-like API exposing Airflow data and operations
License: Apache License 2.0
I need to run an API using both Macro: {{ execution_date }}
and {{ next_execution_date }}
to run some queries, I am using this json below to POST:
Endpoint [POST]: http://localhost:8080/api/experimental/dags/exemplos-api_example/dag_runs
Json:
{
"dag_id" : "exemplos-api_example",
"execution_date" : "2020-08-31T00:41:25"
}
When I trigger my dag, I am trying to access the Airflow Macros but {{ next_execution_date }}
is the same as my current execution date :(
I have no idea how to fix that, I really need your help guys :)
I tried to add next_execution_date on json body, but with no success, I know if I pass this value using conf I can handle that, but I do have a lot of queries and files that depends from this variable, and the easy way and faster way is handle Macro variable.
Thanks in advance :)
Hi,
I'm using your plugin and I got a hard time passing conf to my dag. My dag runs without problems in CLI airflow trigger_dag test --conf '{"workingDir":"/tmp/aZEf"}'
. However, using your plugin, I can't pass my parameter "workingDir", I end up having None
instead of /tmp/aZEf
. I'm using the last version of your plugin and Airflow v1.9.0 with CeleryExecutor.
My post request looks like this : curl -X POST \ http://xxx.xxx.xxx.xxx:xxxx/api/v1/dag_runs \ -H 'authorization: secret \ -H 'cache-control: no-cache' \ -H 'content-type: application/json' \ -d '{"dag_id":"test","conf":{"workingDir":"/tmp/aZEf"}}'
Any help would be appreciated =]
Need to do more testing on dag_run creation, specifically verifying it works with both date ranges before and after start date. But it in general just needs more thorough testing
When setting a default_timezone other than UTC, dag_run API will return naive datetime error.
Can be fixed by adding:
from pytz import timezone
and replacing line 178 and 179 with:
local_tz = timezone(settings.conf.get('core','default_timezone'))
start_date = local_tz.localize(datetime.now())
end_date = local_tz.localize(datetime.now())
Line 102 and Line 219 :
dagbag = DagBag('dags')
replace with :
dag_home = settings.conf.get('core', 'dags_folder')
dagbag = DagBag(dag_home)
This will solve empty dag response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.