Skip to content

airflowctl: action_on_existence flag returns empty success & errors in variables import #51310

@jx2lee

Description

@jx2lee

Apache Airflow version

3.0.1

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

No response

What happened?

related: #50908
details: #50908 (comment)
cc. @bugraoz93 (comment)

What you think should happen instead?

With --action_on_existence fail, request should return 200 OK with right results.errors / results.success. But, empty

How to reproduce

When importing variables with --action_on_existence flag set to fail, overwrite, or skip,
the API responds 200 OK, but both results.success and results.errors are empty.
This makes it impossible to determine whether the existing variables were handled as expected.

Operating System

osx

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

Reproduction Steps

  1. Pre-condition: Two variables already exist in Airflow
[
  {"key": "foo", "value": "1"},
  {"key": "bar", "value": "2"}
]
  1. Prepare import file (vars.json) containing the same keys:
[
  {"key": "foo", "value": "99"},
  {"key": "bar", "value": "88"}
]
  1. Run CLI:
uv run airflowctl variables import vars.json --action_on_existence fail

You'll found empty success/errors.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions