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

[Runtime] Fix run type hints #3620

Merged
merged 6 commits into from
May 23, 2023
Merged

Conversation

alonmr
Copy link
Member

@alonmr alonmr commented May 23, 2023

Fixed the type hints for run and launch methods.
rusnpec / task can also be a RunTemplate.
handler can be either str or callable for dask and handler runtimes.
add optional where missing.
removed duplicated typing import (using from notation with typing because it is overwhelming to have a full notation for methods like run and launch with many parameters)

auto_build=None,
param_file_secrets: Dict[str, str] = None,
notifications: List[mlrun.model.Notification] = None,
runspec: Optional[Union["mlrun.run.RunTemplate", "mlrun.run.RunObject"]] = None,
Copy link
Member

Choose a reason for hiding this comment

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

how come we can pass a concrete and one time a template? can you perhaps elaborate on function docstring when such cases occurs?

Copy link
Member Author

Choose a reason for hiding this comment

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

RunTemplate is essentially a RunObject without a status. We generate a RunObject from whatever is given.
We generate a run object from the template if a RunTemplate is given.
It helped me find some other problems - we also allow dict and there was _create_run_object in BaseRuntime that we forgot to delete

@Tankilevitch Tankilevitch merged commit 7d8fe06 into mlrun:development May 23, 2023
14 checks passed
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

3 participants