Skip to content

Add type annotation to container module variable#3042

Merged
jonathangreen merged 1 commit intomainfrom
chore/container-type-fix
Feb 11, 2026
Merged

Add type annotation to container module variable#3042
jonathangreen merged 1 commit intomainfrom
chore/container-type-fix

Conversation

@jonathangreen
Copy link
Member

Description

Add a type annotation (Services | None) to the _container_instance module-level variable in container.py.

Motivation and Context

Mypy intermittently complains about the type of _container_instance being None. Without an explicit annotation, mypy infers the type from the initial assignment (None), which can cause it to flag usages where the variable holds a Services instance. Adding the explicit Services | None annotation makes the intended type clear and prevents these sporadic type errors.

How Has This Been Tested?

This is a type annotation-only change with no runtime behavior change. Pre-commit hooks passed successfully.

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@jonathangreen jonathangreen requested a review from a team February 11, 2026 18:39
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.04%. Comparing base (194642f) to head (bc52b67).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3042   +/-   ##
=======================================
  Coverage   93.04%   93.04%           
=======================================
  Files         480      480           
  Lines       43711    43711           
  Branches     6029     6029           
=======================================
  Hits        40669    40669           
  Misses       1972     1972           
  Partials     1070     1070           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathangreen jonathangreen force-pushed the chore/container-type-fix branch from 705f4e3 to bc52b67 Compare February 11, 2026 19:13
Copy link
Contributor

@dbernstein dbernstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐎

@jonathangreen jonathangreen merged commit 6a00904 into main Feb 11, 2026
19 checks passed
@jonathangreen jonathangreen deleted the chore/container-type-fix branch February 11, 2026 20:16
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.

2 participants