-
Notifications
You must be signed in to change notification settings - Fork 233
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
Update documents.py #810
Update documents.py #810
Conversation
fix uniondoc
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.
Thank you very much for the PR. Please take a look at the comments and at the pre-commit validation test.
Thank you!
beanie/odm/queries/find.py
Outdated
:param response_type: UpdateResponse | ||
:return: UpdateMany query | ||
""" | ||
self.set_session(session) |
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.
It looks unnecessary to keep the logic part inside the method marked with @overload
. It will not be called at the runtime.
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.
i see fixed
] | ||
], | ||
) -> "FindMany[FindQueryResultType]": | ||
""" | ||
Add sort parameters | ||
:param args: Union[str, Tuple[str, SortDirection], | ||
List[Tuple[str, SortDirection]]] - A key or a tuple (key, direction) | ||
:param args: Union[Any, Tuple[Any, SortDirection], |
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.
I Any a good option? Probably it is possible to limit the number of possible types? Or there is something that blocks it?
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.
The type that can be sortable are
int, float
str
list
tuple
datetime
and object with lt method
Pymongo use Any for sorting
Ah shit |
@roman-right i think im gonna do it with only type hint improving for the union doc issue its within the union_doc folder i was thinking inheriting from document one but there some function not available in union doc so its more complexe than i thought |
Bad timing i had to go and shouldnt have push |
Should be good now i can start again if you want cause with all commits its messy @roman-right |
Hey @CAPITAINMARVEL , Regarding the amount of commits - everything is ok. I use squash merging strategy - it will be 1 commit in the main branch in the end anyway :) |
hopefully this time its good |
fixed ? @roman-right |
Should be good error now @roman-right |
yeah i cant remove that error its like an hacky way but Union Doc find work same as document find so thats why i change doc type with Union [uniondoc and document] |
Hi @CAPITAINMARVEL , |
Hm, it looks like part of the problem has alternative solution there already. Could you please take a look? @CAPITAINMARVEL |
fix uniondoc DocType