prehistoric-carpenter-16793
09/05/2023, 2:42 PM@dataclass_json
@dataclass
class Input:
metric: str
data: dict = field(default_factory=dict)
@task
def load_configs() -> List[Input]:
folder_name = "metrics"
config_files = extract_config_files(folder_name=folder_name)
configs: List[Input] = []
for config_file in config_files:
with open(config_file, "r") as file:
config = Input(config_file, yaml.safe_load(file))
configs.append(config)
return configs
@task
def check_type(configs: List[Input]):
print(type(configs))
print(type(configs[0]))
return type(configs)
@workflow # type: ignore
def start_workflow() -> str:
configs: List[Input] = load_configs()
check_type(configs=configs)
I see that my first task, load_configs()
, finishes successfully and it returns correctly the list of objects but the next task, check_type
, it complains about only generic univariate typing.list[t] type is supported.
I found these similar cases [1], [2] but I do not think that it is applicable to my situation. Any help or idea why I am getting this error? Thank you in advance 🙏tall-lock-23197
prehistoric-carpenter-16793
09/06/2023, 8:38 AM@dataclass_json
@dataclass
class Input:
metric: str
data: str
The problem should be related to the dict most probably?tall-lock-23197
dict
with dict[your_key_type, your_value_type]
?glamorous-carpet-83516
09/06/2023, 5:14 PMprehistoric-carpenter-16793
09/07/2023, 7:27 AMtall-lock-23197
user
09/07/2023, 8:52 AM