Comments (10)
I encountered the same problem.
and I found the test case (airflow_client/test/test_dag_run_api.py) is just shell, with empty test function.
so I think the quality cannot be assured currently.
mybe using raw REST API is a good choice.
from airflow-client-python.
Same problem. It seems you must provide a dag_id to initialize a DAGRun while it gives this read-only error in post_dag_run.
from airflow-client-python.
Same problem here after following https://github.com/apache/airflow-client-python/blob/master/airflow_client/docs/DAGRunApi.md#post_dag_run.
DAGRun requires dag_id in its constructor, but if you provide one the post_dag_run will give the Property is read-only error.
So basically it's not possible to start dagruns using the client.
airflow-client-python.git rev bf439f3
Airflow 2.2.0
from airflow-client-python.
Probably caused by #4
from airflow-client-python.
I have worked around this by re-generating the api client for airflow 2.3.0 with this patch applied. Available from my fork. You can install it in a requirements.txt via:
# apache-airflow-client==2.1.0
-e git://github.com/christhekeele/[email protected]#egg=apache-airflow-client
from airflow-client-python.
Is there any alternate way to trigger task without this client?
from airflow-client-python.
Is there any alternate way to trigger task without this client?
https://airflow.apache.org/docs/apache-airflow/2.2.4/stable-rest-api-ref.html
from airflow-client-python.
POST /api/v1/dags/{dag_id}/dagRuns
{
"conf": {},
"dag_run_id": "test-1",
"logical_date": "2022-05-25T07:12:59.305Z",
"state": "queued"
}
results in below error.
{
"detail": "Property is read-only - 'state'",
"status": 400,
"title": "Bad Request",
"type": "https://airflow.apache.org/docs/apache-airflow/2.2.3/stable-rest-api-ref.html#section/Errors/BadRequest"
}
without "state" param in the payload works 👍
from airflow-client-python.
you can not pass dag_id and external_trigger as part of DagRun ( dag_id is passed in post_dag_run() function)
The following worked for me,
dag_run = DAGRun(
dag_run_id='some_test_run',
conf={"key":"values"}
)
api_response = dag_run_api_instance.post_dag_run(dag_id, dag_run)
from airflow-client-python.
dag_id
, state
and external_trigger
are now read only. They should not be provided in the DagRun
object. With the latest client (2.5.1) we can trigger dag runs like this:
# DagRun
dag_run_api_instance = dag_run_api.DAGRunApi(api_client)
try:
api_response = dag_run_api_instance.post_dag_run(
"25616-bug", dag_run_api.DAGRun(dag_run_id="run_from_python_api_client")
)
pprint(api_response)
except airflow_client.client.OpenApiException as e:
print("Exception when calling DagRunApi->post_dag_run: %s\n" % e)
Closing for now, feel free to reopen if needed.
from airflow-client-python.
Related Issues (20)
- API client configuration lack of support to pass verify_ssl for oauth based token authentication
- How to use cookies?
- why xcom api only provide read api without write api? HOT 1
- [openapi] wrong use of $ref and nullable HOT 3
- User confirmation needed HOT 2
- issue of get_task_instance HOT 1
- Error - "certificate verify failed - unable to get local issuer certificate" while using airflow_client HOT 2
- Kerberos Authentication Support HOT 1
- SLAMiss not allowing null value HOT 3
- Bug: `DAGApi.get_dag_details` fails if `DAG Run Timeout` is `None` HOT 2
- Not possible to trigger dag run HOT 3
- Basic authentication stopped working in 2.5.0 HOT 8
- Airflow Python Client 2.6.0rc1 fails with invalid type variable `execution_timeout` on get_tasks HOT 1
- Airflow Python Client 2.6.0rc2 fails with read-only dag_id attribute on post_dag_run HOT 7
- Draft release announcement in the release guide HOT 1
- Airflow Python Client 2.6.2rc1 "get_tasks" errors out with execution_timeout cannot be None HOT 5
- How Create Users with role Admin? HOT 5
- [TaskInstanceApi.get_task_instances] airflow_client.client.exceptions.ApiTypeError: Invalid type for variable 'trigger' HOT 2
- TaskInstances- "get instance batch" is getting timeout after 1 minute, status code- 504 (~1000 records) HOT 4
- The logical date parameter for DAGRun is incorrect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airflow-client-python.