Commit b44e435
committed
fix: Add TypeAlias annotations to SchemaUnion for mypy compatibility
Resolves mypy errors by adding TypeAlias annotations and using
TYPE_CHECKING to separate type-checking time definitions from runtime
definitions. This ensures mypy recognizes SchemaUnion as a valid type
alias while maintaining runtime compatibility across Python versions.
Fixes mypy errors:
- "Invalid type alias: expression is not a valid type"
- "Variable 'genai.types.SchemaUnion' is not valid as a type"1 parent b080641 commit b44e435
1 file changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
4251 | 4251 | | |
4252 | 4252 | | |
4253 | 4253 | | |
4254 | | - | |
4255 | | - | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
4256 | 4257 | | |
4257 | 4258 | | |
4258 | 4259 | | |
4259 | | - | |
4260 | | - | |
4261 | | - | |
4262 | | - | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
| 4269 | + | |
4263 | 4270 | | |
4264 | 4271 | | |
4265 | 4272 | | |
| |||
0 commit comments