-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Feature Area
/area sdk
/area components
What feature would you like to see?
I'd like to see the kfp
SDK improved with better typing for the @dsl.component
decorator, as it seems to give both inconsistent and incorrect types.
What is the use case or pain point?
Pointing to the discussion I brought up, it seems like the decorator provides incorrect types. If using a stricter LSP such as Pyright (e.g. more strict than VSCode default of Pylance), this leads to many errors during development, as well as failure of autocomplete suggestions.
I'll give one example, where the use of parentheses (or lack thereof) changes the type of the decorated function;


I am slower at developing due to lack of autocomplete & "Go to Definition" behaviour, making it harder to read the source code and understand what objects are actually being used where.
Is there a workaround currently?
I completely disable all type-checking for KFP specifically. I also mainly copy-paste exact examples from docs, as my IDE cannot help much with customisation due to lack of proper typing.
Love this idea? Give it a 👍.