Skip to content
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

Closed
wants to merge 23 commits into from
Closed

Update documents.py #810

wants to merge 23 commits into from

Conversation

CAPITAINMARVEL
Copy link
Contributor

fix uniondoc DocType

Copy link
Member

@roman-right roman-right left a 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!

:param response_type: UpdateResponse
:return: UpdateMany query
"""
self.set_session(session)
Copy link
Member

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.

Copy link
Contributor Author

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],
Copy link
Member

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?

Copy link
Contributor Author

@CAPITAINMARVEL CAPITAINMARVEL Dec 20, 2023

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

@CAPITAINMARVEL
Copy link
Contributor Author

Ah shit

@CAPITAINMARVEL
Copy link
Contributor Author

@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

@CAPITAINMARVEL
Copy link
Contributor Author

Bad timing i had to go and shouldnt have push
now i think its ok

@CAPITAINMARVEL
Copy link
Contributor Author

Should be good now i can start again if you want cause with all commits its messy @roman-right

@roman-right
Copy link
Member

Hey @CAPITAINMARVEL ,
Could you please take a look at the tests?

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 :)

@CAPITAINMARVEL
Copy link
Contributor Author

Hey @CAPITAINMARVEL , Could you please take a look at the tests?

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

@CAPITAINMARVEL
Copy link
Contributor Author

fixed ? @roman-right

@CAPITAINMARVEL
Copy link
Contributor Author

Should be good error now @roman-right

@CAPITAINMARVEL
Copy link
Contributor Author

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]

@roman-right
Copy link
Member

Hi @CAPITAINMARVEL ,
I'll fix the merge conflict and take a look at the error by the end of today

@roman-right
Copy link
Member

Hm, it looks like part of the problem has alternative solution there already. Could you please take a look? @CAPITAINMARVEL

@CAPITAINMARVEL CAPITAINMARVEL closed this by deleting the head repository Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants