ColtenOuO opened a new pull request, #72566:
URL: https://github.com/apache/airflow/pull/72566

   ### Sumarry
   
   `airflow variables delete <key>` calls `Variable.delete(args.key)` and then 
unconditionally prints `Variable <key> deleted`
   , ignoring the return value. `Variable.delete()` already returns the number 
of rows deleted, so when `key` does not exist the command still prints a 
success message and exits 0 -- there is no way to tell, from the CLI's output 
or exit code, whether anything was actually deleted.
   
   ### Change
   
   This PR checks the returned row count and raises `SystemExit` with a "does 
not exist" message when it is zero.
   
   A test for the existing (successful) delete path already existed; this adds 
a matching test for the missing-key path.
   


-- 
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]

Reply via email to