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

Type hint overall improving #929

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

CAPITAINMARVEL
Copy link

Fix correct return type for query update operation, fix type hint for sort, correct return type for document update and removed awaitable making it not able to be used in asyncio task

@CAPITAINMARVEL
Copy link
Author

for expression field it can allow to define the type like inc, only taking number for inc operation, taking any for set ? for current_time maybe taking only datetime or any affiliate things ?

@CAPITAINMARVEL
Copy link
Author

CAPITAINMARVEL commented May 6, 2024

for expression field it can allow to define the type like inc, only taking number for inc operation, taking any for set ? for current_time maybe taking only datetime or any affiliate things ?

@roman-right which i can add if you think its ok (i think it would be great to take that)

other than that my pull request is normally ok (i tested it with pytest)?

**pymongo_kwargs,
) -> DocType:
**pymongo_kwargs: Any,
):
Copy link
Contributor

@alm0ra alm0ra May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove return type?
If you using mypy as a type checker you will facing Error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't return any thing
You can using '-> None'

@@ -1247,19 +1246,19 @@ async def delete(
@classmethod
def find_many_in_all( # type: ignore
cls: Type[FindType],
*args: Union[Mapping[str, Any], bool],
*args: Union[Mapping[Any, Any], bool],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you all *args to Any?
Why it was mpping[str,any]

@alm0ra
Copy link
Contributor

alm0ra commented May 8, 2024

Hi @CAPITAINMARVEL ,
How did you test these types?
Did you use type checker?

@CAPITAINMARVEL
Copy link
Author

Hi @CAPITAINMARVEL , How did you test this types? Did you use type checker?

Thanks for the reply i will fix it

@CAPITAINMARVEL
Copy link
Author

weird there are many sort missing in find

@CAPITAINMARVEL
Copy link
Author

gotta fix BaseFindBitwiseOperator

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.

None yet

2 participants