Skip to content

feat: Conditional parameters (HEXA-1687)#396

Open
mrivar wants to merge 5 commits into
mainfrom
HEXA-1687-conditional-params
Open

feat: Conditional parameters (HEXA-1687)#396
mrivar wants to merge 5 commits into
mainfrom
HEXA-1687-conditional-params

Conversation

@mrivar

@mrivar mrivar commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Related PRs

Add posibility to have a param that disables others.

Changes

  • Added param option disables: List of parameter to disable.
  • Added param option disable_when: Setting to disable the linked params when the parameter is either true or false. True by default.
  • When running a pipeline, check which parameters are disabled -> remove it's value or set to its default

@mrivar mrivar self-assigned this Jun 11, 2026

@DimitriKwihangana DimitriKwihangana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks nice! @mrivar only minor comments I've put!

Comment thread tests/test_ast.py
"required": True,
"directory": None,
"disables": None,
"disableWhen": True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor! I was thinking if we matched both the attribute and this serialisation key to snake_case. for the consistency. I don't where I got this but I see mostly people use Camelcase in Javascript 😂. no strong opinion

@mrivar mrivar Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh yeah, this is quite weird being code in python 😂 this is actually because the .dict() is used as values to be sent to our graphQL endpoint, so it is expecting camelCase. Using snake_case (which would be the normal thing in python) breaks it.
I learned this the hard way, broke it in the other task I did about the dynamic params and @bramj fixed it here: #393

Comment thread tests/test_ast.py
},
)

def test_pipeline_with_disables_param(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if we have it but I was expecting a test for the scenario when a required parameter is disabled

@mrivar mrivar Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll check again and make sure! I think we do but it's always good to double check 😁

Edit: I'm checking and I think we have them in test_pipeline.py, check test_pipeline_run_disabled_required_parameter_skipped and test_pipeline_run_disable_when_false_disables_while_off (for the inverted version), but if you find any other coverage that might be missing lmk!

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.

2 participants