Git Product home page Git Product logo

Comments (7)

potiuk avatar potiuk commented on May 30, 2024 1

cc: @msumit @ephraimbuddy @mik-laj ^^ -> I think we will need your opinion on that one too :).. just removing dag_id is not a huge breaking change, so I would be fine if we just explain it, personallly and explain this was really a buggy behaviour.

from airflow-client-python.

potiuk avatar potiuk commented on May 30, 2024

Related to #74 (both are exposed by the same test script).

from airflow-client-python.

pierrejeambrun avatar pierrejeambrun commented on May 30, 2024

I don't think this is a mistake. DagRun Schema has dump_only dag_id (which seems normal). The dag_id required for triggering a Dag Run is a path parameter, this is working on my end:

    # DagRun
    dag_run_api_instance = dag_run_api.DAGRunApi(api_client)
    dag_id = "dynamic_task_group"
    try:
        api_response = dag_run_api_instance.post_dag_run(
            dag_id,
            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)

Note: Same problem for external_trigger, dump_only. Already defaults to True in the model and the applicative code, so REST API call will end up creating dagrun with extrenal_trigger to True, you cannot set this to False for instance while triggering from the REST API. Which makes sense, those are external triggers.

from airflow-client-python.

potiuk avatar potiuk commented on May 30, 2024

I don't think this is a mistake. DagRun Schema has dump_only dag_id (which seems normal).

I am fine with that.

But I think that raises question - should we be adding an explanation about it in release notes ?

the problem with this is that it is not some artifficial example :).

It did work before (I used that script in the past to test it, and well it worked (I think the problem is that the new OpenAPI is more picky when it comes to validating stuff and it allows to do stuff like this :) (which I understand it should not be done):

        dag_run = DAGRun(
            dag_run_id='some_test_run',
            dag_id=dag_id,
            external_trigger=True,
        )

And the thing is - the example comes from our repo:

https://github.com/apache/airflow-client-python/blob/main/dev/test_python_client.py

And this actually was added as a response to another issue #21 where dag triggering did not work at all :).

So we are facing high likelihood we are going to break workflows of the people whose problem we solved before and even gave them some examples on how to do stuff :)

Actually I am quite fine that we say now "you are doing it wrong" - I think that would be cleanest solution, but likely maybe we should explain it in release notes how to use DAG RUN triggering now at the very least ?

from airflow-client-python.

potiuk avatar potiuk commented on May 30, 2024

What do others think?

from airflow-client-python.

potiuk avatar potiuk commented on May 30, 2024

PR how it could look like here: #78

It also refreshes the infrastructure/examples a bit.

from airflow-client-python.

ephraimbuddy avatar ephraimbuddy commented on May 30, 2024

Nice catch @pierrejeambrun.

Since it worked before, mentioning it in #78 makes sense to me

from airflow-client-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.