-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: make class recognize parent when parent uses "capability" decorator #11078
base: master
Are you sure you want to change the base?
fix: make class recognize parent when parent uses "capability" decorator #11078
Conversation
WalkthroughThe recent changes enhance type safety in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Issue created => #11077 |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- metadata-ingestion/src/datahub/ingestion/api/decorators.py (2 hunks)
Additional comments not posted (3)
metadata-ingestion/src/datahub/ingestion/api/decorators.py (3)
8-8
: Addition of the type variableT
is appropriate.This enhances the decorator's flexibility by allowing it to work with any type.
92-92
: Type annotation change incapability
function signature enhances type safety.Changing the type annotation to
Callable[[Type[T]], Type[T]]
ensures that the decorator maintains consistent types.
97-97
: Type annotation change inwrapper
function enhances type safety.Changing the type annotation to
Type[T]
ensures that thewrapper
function operates on the same generic type, maintaining type consistency.
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.
LGTM
@MayasMess looks like the linter isn't happy with these changes |
…decorator' into add-generic-type-for-capability-decorator
I added a bound class to get around the linter but I'll let you see if the name fits. I think it's not very explicit... |
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
capability
decorator, ensuring consistent type handling across decorated classes.