Leondon9 opened a new issue, #62695:
URL: https://github.com/apache/airflow/issues/62695
### Apache Airflow version
main (3.x)
### What happened
`airflow-ctl variables import` supports `--action-on-existing-key`
(`overwrite`/`fail`/`skip`), but `pools import` and `connections import`
hardcode `action_on_existence=FAIL`. This means importing pools or connections
fails if any entity already exists, with no way to overwrite or skip.
This is an inconsistency within the same package — all three commands use
the same `BulkActionOnExistence` enum and the same bulk API pattern, but only
`variables import` exposes the option.
For `connections`, this is also a regression from Airflow 2, which had
`--overwrite` on `airflow connections import`.
### What you think should happen instead
`pools import` and `connections import` should support
`--action-on-existing-key` (`overwrite`/`fail`/`skip`), matching the existing
`variables import` behavior.
### How to reproduce
```bash
# Export a pool, then try to re-import it — fails with no workaround
airflow-ctl pools export pools.json
airflow-ctl pools import pools.json # fails because pool already exists
# Same for connections
airflow-ctl connections export connections.json
airflow-ctl connections import connections.json # fails
```
### Operating System
Any
### Versions of Apache Airflow Providers
N/A
### Deployment
Other
### Deployment details
_No response_
### Anything else
**Root cause**: Three different developers implemented pool (May 28),
variable (May 29), and connection (Jul 1) import independently. Variable got
the `--action-on-existing-key` flag; pool and connection did not.
**References**:
- `ARG_VARIABLE_ACTION_ON_EXISTING_KEY` in `cli_config.py:270-276`
- `pool_command.py:116` — `action_on_existence=BulkActionOnExistence.FAIL`
- `connection_command.py:65` —
`action_on_existence=BulkActionOnExistence("fail")`
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]