def test_sanitize_callable_params():
    """Callback functions are not serializable.

    Therefore, we get them a chance to return something and if the returned type is not accepted, return None.

    """

    def return_something():
        return "something"

    def wrapper_something():
        return return_something

    class ClassNoArgs:
        def __init__(self):
            pass

    class ClassWithCall:
        def __call__(self):
            return "name"

    params = Namespace(
        foo="bar",
        something=return_something,
        wrapper_something_wo_name=(lambda: lambda: "1"),
        wrapper_something=wrapper_something,
        class_no_args=ClassNoArgs,
        class_with_call=ClassWithCall,
    )

    params = _convert_params(params)
    params = _flatten_dict(params)
    params = _sanitize_callable_params(params)
    assert params["foo"] == "bar"
    assert params["something"] == "something"
    assert params["wrapper_something"] == "wrapper_something"
    assert params["wrapper_something_wo_name"] == "<lambda>"
    assert params["class_no_args"] == "ClassNoArgs"
    assert params["class_with_call"] == "ClassWithCall"
Callback functions are not serializable.

    Therefore, we get them a chance to return something and if the returned type is not accepted, return None.

    
tests/tests_fabric/utilities/test_logger.py