Repository navigation
declare the public members BaseDatabaseWrapper was missing - #413
Merged
Merged
Conversation
…ters atomic_blocks is set in __init__ and inc_thread_sharing/dec_thread_sharing are public methods; code that hands a connection to another thread (test helpers, mostly) couldn't reference them.
get_database_version, check_database_version_supported, close_if_health_check_failed, health_check_enabled, health_check_done and rollback_exc were missing too. The class now declares everything public that Django 6.0 defines on it.
1 task done
sobolevn
pushed a commit
to typeddjango/django-stubs
that referenced
this pull request
Oct 23, 2026
…butes (#3725) # I have made things! `BaseDatabaseWrapper.__init__` sets `rollback_exc`, `health_check_enabled` and `health_check_done`, but the stub didn't declare them. ## Related issues Ported from sbdchd#413 ## AI Policy - [ ] I have read and agree to the [AI Policy](https://github.com/typeddjango/django-stubs/blob/master/.github/AI_POLICY.md), removed any "Co-Authored-By" lines attributing coding agents, and manually reviewed the final result
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BaseDatabaseWrapperwas missing nine of its public members from the stub. These are the ones that exist on the class in Django 6.0.8 but weren't declared:atomic_blocks[]in__init__;transaction.atomic()pushesAtomicinstances onto itrollback_excNonehealth_check_enabled,health_check_done__init__inc_thread_sharing(),dec_thread_sharing()allow_thread_sharingclose_if_health_check_failed()get_database_version()check_database_version_supported()NotSupportedErrorif the server is too oldI found the first three through code that hands a connection to another thread. The rest turned up when I compared the stub against everything the class defines, so this closes the class out rather than patching one gap at a time.
tests/pyright/test_database_wrapper.pycovers all nine and fails without the stub change. It doesn't touch the same files as #407, so the two can land in either order.