-
Notifications
You must be signed in to change notification settings - Fork 1
fix(model): Analyzer project scopes #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,8 +59,9 @@ class Project(BaseModel): | |||||||||
| description="The description of project.", | ||||||||||
| ) | ||||||||||
| homepage_url: str = Field(..., description="The URL to the project's homepage.") | ||||||||||
| scope_dependencies: set[Scope] | None = Field( | ||||||||||
| None, | ||||||||||
| scope_dependencies: set[Scope] = Field( | ||||||||||
| default_factory=set, | ||||||||||
| alias="scopes", | ||||||||||
| description="Holds information about the scopes and their dependencies of this project if no DependencyGraph" | ||||||||||
| "is available. NOTE: Do not use this property to access scope information. Use scopes instead, which is" | ||||||||||
| "correctly initialized in all cases.", | ||||||||||
|
Comment on lines
66
to
67
|
||||||||||
| "is available. NOTE: Do not use this property to access scope information. Use scopes instead, which is" | |
| "correctly initialized in all cases.", | |
| "is available. NOTE: In Python, use the 'scope_dependencies' attribute to access scope information; the" | |
| "input alias 'scopes' is provided for compatibility.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope_dependenciesis typed asset[Scope], butScopeis a mutable PydanticBaseModel(not frozen) and does not implement__hash__, so parsing a non-emptyscopeslist will raiseTypeError: unhashable type: 'Scope'when building the set. Consider switching this field to a list (to match YAML/JSON lists), or makeScopehashable (e.g., frozen + stable__hash__/__eq__) if set semantics are required.