-
-
Notifications
You must be signed in to change notification settings - Fork 459
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
Fixed Collector.data and NestedObjects.data types #1366
Conversation
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.
Looks good to me.
Take a look at the CI failures |
As suggested by kezabelle, I have made the changes to the code and used the type match |
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.
Thanks.
FWIW the downside of using Model
instead of Any
is that when you want to access the fields and methods of a particular model subclass (e.g. auth.models.User
), mypy won't let you do that without an explicit cast()
or isinstance()
check. But either is fine by me.
Fixed Collector.data and NestedObjects.data types
Related issues
Fixes #1271
Code changes
Specified
dict[type[Model], set[Model] | list[Model]]
type forCollecor.data
attribute