-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add decorator type hint #101
base: main
Are you sure you want to change the base?
Conversation
nest/core/decorators/http_method.py
Outdated
@@ -1,6 +1,9 @@ | |||
from typing import Callable, List, Union, TypeVar, ParamSpec, TypeAlias |
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.
❌ Failed check: CLI Test / test (MongoDB)
I’ve attached the relevant part of the log for your convenience:
ImportError: cannot import name 'ParamSpec' from 'typing' module in Python 3.9
Finding type: Log Error
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.
added version check
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 like this comment has been addressed in commit 58d4b04. The code now checks the Python version and imports ParamSpec from typing_extensions for versions below 3.10, resolving the ImportError for Python 3.9.
nest/core/decorators/http_method.py
Outdated
@@ -1,6 +1,16 @@ | |||
from typing import Callable, List, Union, TypeVar, TypeAlias |
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.
❌ Failed check: CLI Test / test (PostgresSync)
I’ve attached the relevant part of the log for your convenience:
ImportError: cannot import name 'TypeAlias' from 'typing' module in Python 3.9
Finding type: Log Error
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 like this comment has been addressed. The commit 9de7fce modified the import statement to handle different Python versions, addressing the ImportError for TypeAlias in Python 3.9. The code now conditionally imports TypeAlias from typing_extensions for versions below 3.10, resolving the issue raised in the thread.
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.
same as above
nest/core/decorators/http_method.py
Outdated
@@ -1,6 +1,16 @@ | |||
from typing import Callable, List, Union, TypeVar, TypeAlias |
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.
❌ Failed check: CLI Test / test (SyncORM)
I’ve attached the relevant part of the log for your convenience:
ImportError: cannot import name 'TypeAlias' from 'typing' module in Python 3.9
Finding type: Log Error
User description
Can see the before:
![image](https://private-user-images.githubusercontent.com/97923827/411218677-59487d52-294a-4d1d-9638-63b9eafc95dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MjcwMzgsIm5iZiI6MTczOTYyNjczOCwicGF0aCI6Ii85NzkyMzgyNy80MTEyMTg2NzctNTk0ODdkNTItMjk0YS00ZDFkLTk2MzgtNjNiOWVhZmM5NWRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEzMzg1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhZGQwZjc5Nzc4ZmJiOTM5MzdiNTRmOTRkZmNmYzhjYmMwNzdjZjc1NTQzZmE1MzY0MjM2NDQzMjgzY2QwNzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-VKDDNMPf4tN3nwmvx-kTWOhvb0pLhuKfQmla18S6XE)
![image](https://private-user-images.githubusercontent.com/97923827/411218711-13acf789-6a3d-4ff2-af72-85d0c57ae317.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MjcwMzgsIm5iZiI6MTczOTYyNjczOCwicGF0aCI6Ii85NzkyMzgyNy80MTEyMTg3MTEtMTNhY2Y3ODktNmEzZC00ZmYyLWFmNzItODVkMGM1N2FlMzE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEzMzg1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU0MTNkYTY4MGJkZTQ2MjIyNGIwMmE3YzdjNzk4MzU1MWViMDcxYzQ2OTMwZTYyYmU2M2Q3NzNjYTJlMThkMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jxzFyqwnXAi7DvIqUCZQhVmH_r2_bwP-88ikGhIjQKE)
After:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Enhances type hinting across multiple decorator files in the nest/core/decorators directory. Introduces generic type variables and updates function signatures to improve type safety and code clarity. Adds conditional imports for typing features based on Python version compatibility.
Modified files (3)
Latest Contributors(2)
Modified files (7)
Latest Contributors(2)