Use ValueError when no ArangoDB collection operation is specified - #70539
Conversation
Calling ArangoDBCollectionOperator without any operation is an input-validation error, so it should not raise the broad AirflowException the community is actively reducing. Follows the clean-up pattern of apache#66279.
potiuk
left a comment
There was a problem hiding this comment.
Thanks — best of your three exception PRs in this batch.
ValueError is right: "at least one operation must be specified" is a caller-argument problem, not an Airflow-runtime condition. Import cleaned up, ratchet entry removed outright rather than decremented.
What sets this one apart is that it adds a test that didn't exist. #70540 and #70537 updated assertions on paths already covered; here test_no_operation_fails is new coverage for a branch that had none — with match= pinning the message and insert_documents.assert_not_called() proving the operator bails before touching the hook rather than merely raising somewhere. That last assertion is the one people skip.
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
Part of the ongoing clean-up of broad
AirflowExceptionusages (enforced by thecheck-no-new-airflow-exceptionsratchet), following the pattern of #66279.ArangoDBCollectionOperator.executeraisedAirflowExceptionwhen none of the insert/update/replace/delete operations was specified — a plain input-validation error, now aValueError. Theknown_airflow_exceptions.txtentry for the file drops from 1 to 0. The raise had no test coverage, so the PR adds one asserting the new type and that no hook operation is invoked.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines