devYRPauli commented on issue #61594:
URL: https://github.com/apache/airflow/issues/61594#issuecomment-6219784102

   @jscheffl I am working on this, and I build on your review of #61665. 
@Byron94odhiambo, if you plan to come back to your PR, tell me and I will step 
back.
   
   My plan:
   
   - No change to the `Param` class. A child param declares two schema keys, 
which pass through to the schema like `values_display` and `section`. 
`depends_on` names the parent param. `options_map` maps each parent value to 
the allowed child values.
   - The trigger form shows the child as a dropdown with the options for the 
current parent value. When the parent changes and the child value is not in the 
new options, the form sets the child to null. A chain such as country -> region 
-> city works, because each child reads only its own parent.
   - `SerializedParamsDict.validate()` and the SDK `ParamsDict.validate()` 
check that the child value is in `options_map` for the parent value. A REST API 
or CLI trigger with a mismatched pair then fails at trigger time with a 
`ParamValidationError`.
   - Docs go in `params.rst` next to `values_display`, and the demo goes in 
`example_params_ui_tutorial.py`.
   
   About `dependentSchemas`: Airflow validates each param against its own 
schema, and there is no Dag-level object schema. A JSON Schema conditional has 
nowhere to attach without a larger change. The `options_map` check gives the 
same pair validation.
   
   Does this shape work for you? The other option is one nested key from the 
issue, `depends_on={"param": "country", "mapping": {...}}`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to