Skip to content

fix: add __call__ to MockOptional for WTForms validator compatibility#63823

Open
YoannAbriel wants to merge 1 commit intoapache:mainfrom
YoannAbriel:fix/issue-63803
Open

fix: add __call__ to MockOptional for WTForms validator compatibility#63823
YoannAbriel wants to merge 1 commit intoapache:mainfrom
YoannAbriel:fix/issue-63803

Conversation

@YoannAbriel
Copy link
Contributor

HookMetaService.MockOptional lacks a __call__ method. When FAB initializes WTForms forms during POST /auth/token, stored MockOptional instances fail check_validators because they're not callable — every token request returns 500.

Added __call__(self, form, field) as a no-op so MockOptional satisfies the WTForms validator protocol. Added unit tests.

Closes: #63803


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4, claude-opus-4-6)

Generated-by: Claude Code (Opus 4, claude-opus-4-6) following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@eladkal eladkal added this to the Airflow 3.1.9 milestone Mar 18, 2026
@eladkal eladkal added backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch type:bug-fix Changelog: Bug Fixes labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] POST /auth/token returns 500 - HookMetaService.MockOptional is not callable when FAB initializes AppBuilder

2 participants