Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/add_missing_cast_import_when_using_const.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
default: patch
---

# Add missing `cast` import when using `const`

Fixed by PR #1072. Thanks @dorcohe!
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ dmypy.json
# JetBrains
.idea/

# Visual Studio Code
.vscode/

test-reports/

/coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion openapi_python_client/parser/properties/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ def get_imports(self, *, prefix: str) -> set[str]:
if self.required:
return {"from typing import Literal"}
return {
"from typing import Literal, Union",
"from typing import Literal, Union, cast",
f"from {prefix}types import UNSET, Unset",
}
Loading