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

Expose params/ ParamsDependency in the Python API. #6507

Closed
daavoo opened this issue Aug 30, 2021 · 2 comments · Fixed by #7613
Closed

Expose params/ ParamsDependency in the Python API. #6507

daavoo opened this issue Aug 30, 2021 · 2 comments · Fixed by #7613
Labels
A: api Related to the dvc.api feature request Requesting a new feature

Comments

@daavoo
Copy link
Contributor

daavoo commented Aug 30, 2021

params are easy to include in a pipeline via templating but using them inside a python script might not be that trivial and require several changes in the user's code (i.e. when a stage uses several params from different params files).

I think that it would be nice to expose some function in the public API that would take care of loading the params associated to a stage and returning them as python objects, directly usable in the python script.

It could be something like dvc.api.get_params() and would take care of loading only the params defined in the params section of the stage.

@daavoo daavoo added feature request Requesting a new feature ui user interface / interaction A: templating Related to the templating feature labels Aug 30, 2021
@daavoo daavoo changed the title Expose params/ ParamDependency in the Python API. Expose params/ ParamsDependency in the Python API. Aug 30, 2021
@skshetry skshetry added A: api Related to the dvc.api and removed ui user interface / interaction A: templating Related to the templating feature labels Aug 31, 2021
@daavoo
Copy link
Contributor Author

daavoo commented Feb 14, 2022

For reference, open source project implementing an API similar to what it's described in the issue https://docs.orchest.io/en/stable/fundamentals/sdk/index.html#api-parameters

daavoo added a commit that referenced this issue Apr 21, 2022
daavoo added a commit that referenced this issue Apr 21, 2022
@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented May 5, 2022

defined in the params section of the stage

How would DVC know what stage this Python file is associated with? Would it only work automatically if the file is in the cmd field of dvc.yaml? If you have to specify which stage then it's less "magical".

UPDATE: Answer in #7613

daavoo added a commit that referenced this issue Jun 4, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
daavoo added a commit that referenced this issue Jun 4, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
daavoo added a commit that referenced this issue Jun 7, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
daavoo added a commit that referenced this issue Jun 9, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
daavoo added a commit that referenced this issue Jun 16, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
daavoo added a commit that referenced this issue Jun 20, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
daavoo added a commit that referenced this issue Jun 21, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
efiop pushed a commit that referenced this issue Jun 21, 2022
Closes #6507

Uses `repo.params.show` with custom error_handler and postprocess the outputs for more user-friendly structure.

Extend `repo.params.show` to accept `stages` argument to cover the "params of current stage" use case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: api Related to the dvc.api feature request Requesting a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants