fix: import the submodules these two files use - #57
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Two places reach a submodule through its parent package without importing it: ```python import requests ... class Token_Auth(requests.auth.AuthBase): ``` ```python import yaml ... raise yaml.constructor.ConstructorError ``` Both work today, and only because `requests` and `yaml` happen to import those submodules themselves as part of their own initialisation. Nothing in the language guarantees that: `import requests` binds the package, not its children, and a release that stops importing `auth` eagerly turns this into an `AttributeError` at class definition time, which is to say at import of `ascenderkit`. Imported by name instead, which is what the code means and what a reader would expect: ```python from requests.auth import AuthBase from yaml.constructor import ConstructorError ``` This also clears the two `possibly-missing-submodule` warnings the type checker reports, which is how it surfaced. Note for whoever merges: ctrliq#25 and ctrliq#26 also edit `api/client.py`, so whichever lands after them needs a rebase. Verified with `black --check`, `flake8` and the unit suite, 355 passing.
blaipr
force-pushed
the
fix/import-submodules-explicitly
branch
from
September 13, 2026 09:03
7656a8a to
68accef
Compare
cigamit
approved these changes
Sep 13, 2026
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.
Two places reach a submodule through its parent package without importing it:
Both work today, and only because
requestsandyamlhappen to import those submodules themselves as part of their own initialisation. Nothing in the language guarantees that:import requestsbinds the package, not its children, and a release that stops importingautheagerly turns this into anAttributeErrorat class definition time, which is to say at import ofascenderkit.Imported by name instead, which is what the code means and what a reader would expect:
This also clears the two
possibly-missing-submodulewarnings the type checker reports, which is how it surfaced.Note for whoever merges: #25 and #26 also edit
api/client.py, so whichever lands after them needs a rebase.Verified with
black --check,flake8and the unit suite, 355 passing.