uranusjr commented on code in PR #55111:
URL: https://github.com/apache/airflow/pull/55111#discussion_r2430732114
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/tasks.py:
##########
@@ -93,11 +96,11 @@ def validate_weight_rule(cls, wr: str |
PriorityWeightStrategy | None) -> str |
@field_validator("params", mode="before")
@classmethod
- def get_params(cls, params: abc.MutableMapping | None) -> dict | None:
+ def get_params(cls, params: SerializedParamsDict | None) -> dict | None:
"""Convert params attribute to dict representation."""
if params is None:
return None
- return {param_name: param_val.dump() for param_name, param_val in
params.items()}
+ return {k: v.resolve(suppress_exception=True) for k, v in
params.items()}
Review Comment:
It’s still possible for this to raise if no default is provided. I guess it
would be possible to make this _never_ raise (returning None without default)
instead, but it’s also somewhat awkward to have a different interface to the
sdk class.
--
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]