def _check_types()

in osci/actions/base.py [0:0]


    def _check_types(self, passed: dict):
        for k, v in passed.items():
            param = self.param_map[k]
            if param.type == datetime and isinstance(v, str):
                datetime.strptime(v, param.datetime_format or DAY_FORMAT)
                continue
            if param.type == int and isinstance(v, str):
                int(v)
                continue
            if not isinstance(v, param.type):
                raise TypeError(f'Param `{k}` type must be: `{param.type}` not `{type(v)}` (passed value: `{v}`)')
            if param.choices and (v not in param.choices):
                raise AttributeError(f"Param `{k}` must have values: {param.choices}")