Skip to content

Fix Config subclass attribute discovery and caching#1258

Open
jmahotiedu wants to merge 2 commits intodatabricks:mainfrom
jmahotiedu:fix-config-subclass-attributes-1069
Open

Fix Config subclass attribute discovery and caching#1258
jmahotiedu wants to merge 2 commits intodatabricks:mainfrom
jmahotiedu:fix-config-subclass-attributes-1069

Conversation

@jmahotiedu
Copy link

Summary

  • fix Config.attributes() to cache metadata per-class instead of inheriting another class's cache via hasattr
  • resolve ConfigAttribute descriptors and annotations across the class MRO so subclasses inherit base config fields
  • add a regression test proving a Config subclass can initialize with inherited fields even when attribute cache is cold

This addresses the behavior reported in #1069 where subclassed configs could ignore inherited fields and fail with default-auth errors.

Testing

  • uv run --no-project --with pytest --with requests --with google-auth --with protobuf --with requests-mock --with pyfakefs -- python -m pytest tests/test_core.py -k "config_can_be_subclassed or config_subclass_inherits_attributes"
  • uv run --no-project --with pytest --with pytest-mock --with requests --with google-auth --with protobuf --with requests-mock --with pyfakefs -- python -m pytest tests/test_config.py

@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 1258
  • Commit SHA: dc835c44ccadba8c4894b1049d4717ef71d29a7d

Checks will be approved automatically on success.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant