Skip to content

Airflow Datafusion Hook: Bug in CDAP Program Start Status Validation & API Usage #50387

Description

@bhardwaj-priyanshu

Apache Airflow version

3.0.0

If "Other Airflow 2 version" selected, which one?

No response

What happened?

There is a issue within the airflow/providers/google/cloud/hooks/datafusion.py concerning how it interacts with CDAP's Lifecycle Microservices for starting programs.

Full Error

[2025-05-05T12:19:53.950+0000] {taskinstance.py:2907} ERROR - Task failed with exception
Traceback (most recent call last):
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/models/taskinstance.py", line 465, in _execute_task
    result = _execute_callable(context=context, **execute_callable_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/models/taskinstance.py", line 432, in _execute_callable
    return execute_callable(context=context, **execute_callable_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/models/baseoperator.py", line 401, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/providers/google/cloud/operators/datafusion.py", line 825, in execute
    pipeline_id = hook.start_pipeline(
                  ^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/providers/google/cloud/hooks/datafusion.py", line 500, in start_pipeline
    return response_json[0]["runId"]
           ~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'runId'

Image

What you think should happen instead?

There are two issues within the airflow/providers/google/cloud/hooks/datafusion.py concerning how it interacts with CDAP's Lifecycle Microservices for starting programs.

1. Insufficient Status Code Checking

2. [Preferred Approach] Suboptimal API Usage for Single Program Starts

How to reproduce

Trigger the CDF start pipeline with wrong runtime args or incorrect program.

Operating System

I am not sure how is that related to the issue. NA

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on May 9, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  2. potiuk commented on May 9, 2025

    @potiuk
    Member
  3. not-so-rabh commented on May 10, 2025

    @not-so-rabh

    Hello new here I am done with the setup. Okay to take this up?

  4. thineshcv commented on May 10, 2025

    @thineshcv

    interested to take this issue

  5. Lzzz666 commented on May 10, 2025

    @Lzzz666
    Contributor

    I’m willing to give it a try.

  6. added
    kind:bugThis is a clearly a bug
    and removed
    needs-triagelabel for new issues that we didn't triage yet
    on May 13, 2025
  7. 7 remaining items

  8. potiuk commented on Jun 5, 2025

    @potiuk
    Member

    feel free

  9. added a commit that references this issue on Nov 25, 2025
    675237f
  10. added a commit that references this issue on Nov 29, 2025
    92d2d63
  11. added a commit that references this issue on Dec 20, 2025
    a4f2b33
  12. added a commit that references this issue on Jan 2, 2026
    e5a57bd
  13. added a commit that references this issue on Jan 9, 2026
    6562088
  14. shahar1 commented on Jan 17, 2026

    @shahar1
    Contributor

    There are issues with #58698 which requires it to be reverted (see #60701).

    Once reverted, we'll get back to ground zero, so I reopen this issue.

    @chirodip98 Could you please comment here so I could assign you to this task?

  15. chirodip98 commented on Jan 17, 2026

    @chirodip98
    Contributor

    Kindly assign , once revert is done : )

  16. added a commit that references this issue on Feb 8, 2026
    36f22dc
  17. added a commit that references this issue on Mar 4, 2026
    ace6739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions