Rath icon indicating copy to clipboard operation
Rath copied to clipboard

[Causal Service] Explainer Parameter 'Target' needs a default.

Open baa-ableton opened this issue 2 years ago • 2 comments

I believe a default Field parameter needs to be added to ExplainerParams.target.

To reproduce:

cd ./services/causal-service && bash fetch.sh
uvicorn main:app --reload --host 0.0.0.0:8001`
  File "/home/dataviz/investigation/Rath/services/causal-service/main.py", line 9, in <module>
    import interfaces as I
  File "/home/dataviz/investigation/Rath/services/causal-service/interfaces.py", line 62, in <module>
    from algorithms.common import OptionalParams, AlgoInterface, getCausalRequest, CausalAlgorithmResponse, CausalAlgorithmData
  File "/home/dataviz/investigation/Rath/services/causal-service/algorithms/__init__.py", line 15, in <module>
    from .dowhy.Explainer import Explainer
  File "/home/dataviz/investigation/Rath/services/causal-service/algorithms/dowhy/Explainer.py", line 27, in <module>
    class Explainer(common.AlgoInterface):
  File "/home/dataviz/investigation/Rath/services/causal-service/algorithms/dowhy/Explainer.py", line 29, in Explainer
    def __init__(self, dataSource: List[common.IRow], fields: List[common.IFieldMeta], params: Optional[ParamType] = ParamType()):
  File "/home/dataviz/.local/lib/python3.10/site-packages/pydantic/main.py", line 150, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Explainer Algorithm
target
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.0.3/v/missing

baa-ableton avatar Jul 24 '23 14:07 baa-ableton

I have met the same issue. Did you figure out what is going on here? I guess assign Target parameter as [], but still don't understand the exact meaning here. Thanks for sharing.

MarshBear avatar Oct 26 '23 09:10 MarshBear

@MarshBear I have a PR that addresses this: https://github.com/Kanaries/Rath/pull/384

baa-ableton avatar Oct 30 '23 09:10 baa-ableton