Skip to content

fix(core): ensure subdomain check returns bool when range absent - #1630

Open
AlessandroPomponio wants to merge 1 commit into
ap_1626_fix_subdomain_of_discrete_domainfrom
ap_1629_fix_subdomain_returning_none
Open

AlessandroPomponio wants to merge 1 commit into
ap_1626_fix_subdomain_of_discrete_domainfrom
ap_1629_fix_subdomain_returning_none

Conversation

@AlessandroPomponio

@AlessandroPomponio AlessandroPomponio commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes a bug where is_subdomain_of_discrete_domain could return None instead of False when the test domain has no range but the discrete domain does. The expression used was relying on short-circuit evaluation of a logical and, which evaluates to the falsy operand itself (None) rather than the boolean False.

High-level Changes

  • ado/schema/domain.py: Wrapped the subdomain range-comparison expression in bool() to guarantee a boolean return value.
  • tests/schema/test_domain.py: Tightened the existing assertion to use strict identity checks (is False / is True), and added the missing reverse-direction test case.

Impact

Any caller that was checking the return value with strict boolean identity (is False) would have received an incorrect result in the affected branch. After this fix, the function is guaranteed to return a proper bool in all code paths.


AI Disclosure: The code and this PR description were generated using IBM Bob and reviewed manually.

@AlessandroPomponio AlessandroPomponio added the ci Enables CI integration label Oct 30, 2026
@AlessandroPomponio
AlessandroPomponio force-pushed the ap_1629_fix_subdomain_returning_none branch from 8f4ca55 to 6547630 Compare October 30, 2026 15:22
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Enables CI integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: is_subdomain_of_discrete_domain can return None instead of False

2 participants