| 1 | from typing import Any |
| 2 | |
| 3 | |
| 4 | def add_custom_yaml_representer(data_type: type, representer_fn: Any) -> None: |
| 5 | """ |
| 6 | Add custom representer to regression YAML dumper. It is polymorphic, so it works also for |
| 7 | subclasses of `data_type`. |
| 8 | |
| 9 | :param type data_type: Type of objects. |
| 10 | :param callable representer_fn: Function that receives object of `data_type` type as |
| 11 | argument and must return a YAML-convertible representation. |
| 12 | """ |
| 13 | from .data_regression import RegressionYamlDumper |
| 14 | |
| 15 | return RegressionYamlDumper.add_custom_yaml_representer(data_type, representer_fn) |