Use ValueError for unsupported recursive glob in ADLS upload - #70540
Conversation
An unsupported '**' glob in local_path 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 — textbook version of this migration. An unsupported glob pattern is a caller-supplied argument error, which is exactly what ValueError is for, and the message is unchanged so nothing user-facing shifts except the type.
Three things done right that often get missed in this campaign: the now-unused AirflowException import is removed rather than left dangling; the known_airflow_exceptions.txt entry is deleted outright (count 1 -> 0) rather than decremented to a stale zero; and the test gains a match= argument, so it now pins the message as well as the type — strictly stronger than before.
Worth noting for completeness: ValueError isn't a subclass of AirflowException, so a Dag wrapping this operator in except AirflowException stops catching it. That's inherent to the migration rather than anything wrong here, and the ratchet file exists precisely to track it — just flagging it's a real behaviour change, not a pure refactor.
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.LocalFilesystemToADLSOperator.executeraisedAirflowExceptionwhenlocal_pathcontains an unsupported**recursive glob — a plain input-validation error, now aValueError. Theknown_airflow_exceptions.txtentry for the file drops from 1 to 0, and the existing test asserts the new type.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines