feat: SDK - pipeline run parameters - dynamic choices (HEXA-1620)#385
Open
mrivar wants to merge 19 commits into
Open
feat: SDK - pipeline run parameters - dynamic choices (HEXA-1620)#385mrivar wants to merge 19 commits into
mrivar wants to merge 19 commits into
Conversation
…-dynamic-choices Conflicts: openhexa/sdk/pipelines/parameter/__init__.py openhexa/sdk/pipelines/parameter/decorator.py
yolanfery
approved these changes
May 13, 2026
Contributor
yolanfery
left a comment
There was a problem hiding this comment.
Very very tricky one, but it looks good to me, well done
Cool tests as well 👌
No comment, just a comment related to the backend : I feel like the SDK shouldn't parse the file format but should delegate that to the backend based on extension and/or content. This would simplify interfaces
Comment on lines
+126
to
+132
| def test_decorator_with_string_shorthand(self): | ||
| @parameter(code="district", type=str, choices="districts.csv") | ||
| def my_pipeline(district): | ||
| pass | ||
|
|
||
| params = my_pipeline.get_all_parameters() | ||
| assert isinstance(params[0].choices, ChoicesFromFile) |
mrivar
commented
May 14, 2026
| dependencies = [ | ||
| "urllib3<3", | ||
| "multiprocess~=0.70.15", | ||
| "requests>=2.31,<2.34", |
Author
There was a problem hiding this comment.
Changed because we were getting an error on conda build:
https://github.com/BLSQ/openhexa-sdk-python/actions/runs/25662804662/job/75327513034
conda-forge recently published requests 2.34.1, which didn't exist when the previous pin was written
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related PRs:
Lets pipeline parameters load their valid choices from a file at runtime, rather than requiring a hardcoded list.
Changes
ChoicesFromFile("path/to/file.csv")descriptor — supports CSV, JSON, YAMLchoices="districts.csv"is equivalent to the explicit form@parameterdecorator and are parsed correctly from pipeline source files (AST round-trip)parameter.pyinto aparameter/package (types, decorator, widgets, choices — each in their own file)How/what to test
@parameter("district", type=str, choices="districts.csv")and check that the platform renders a dynamic dropdown populated from that filechoices=["UG", "KE"]) still work as beforepytest tests/test_choices.py