question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Re-enable extra_code parameter for Python components.

See original GitHub issue

Feature Area

/area sdk

What feature would you like to see?

In KFP v1, there’s an option to extend lightweight python components via extra_code which enables to have non-primitive values as defaults supported. However in KFPv2 this seems to be largely unsupported. Even in KFP v1, seems to be discouraged to use as create_component_from_func does not support it and func_to_container_op seems to be officially discouraged by maintainers (see: #7794 )

What is the use case or pain point?

Extending python lightweigh decorator functionality to use custom defaults that are not primitives.

Is there a workaround currently?

func_to_container_op in KFP v1 does seem to work fine. However this ask is more related to keep this functionality moving forward.


Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
casassgcommented, Jul 21, 2022

@connor-mccarthy I think this won’t likely work. Essentially what you are asking is users to redo the entire lightweight python decorator just to support non-native types. This seems quite the added overhead for something that seems rather a common use case imho.

0reactions
connor-mccarthycommented, Jul 22, 2022

Thanks, @casassg. That explanation is very helpful and makes a compelling case for including an extra_code parameter.

BTW: Support in lightweight components for custom artifact types from a third-party library is a feature that will be added soon. It doesn’t solve for all of the use cases you’re describing, but would for the Input[MyCustomArtifact] use case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

inspect — Inspect live objects — Python 3.11.1 documentation
Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback,...
Read more >
Building Python function-based components - Kubeflow
This section demonstrates how to get started building Python function-based components by walking through the process of creating a simple ...
Read more >
python - How to extract parameters from a list and pass them ...
What is a good, brief way to extract items from a list and pass them as parameters to a function call, such as...
Read more >
Python Functions — Parameters and Arguments
Parameters define what types of arguments a function can accept. ... of an argument list and/or be passed as elements of an iterable...
Read more >
Functions - Advanced R. - Hadley Wickham
Function components. All R functions have three parts: the body() , the code inside the function. the formals() , the list of arguments...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found