-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#149] Pipeline - task template #150
Conversation
|
||
|
||
def from_dict(data: dict) -> Config: | ||
return dacite.from_dict(data_class=Config, data=data) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# type: ignore
제거 시 pyright failed
soynlp/soynlp/configs/config.py
soynlp/soynlp/configs/config.py:4:8 - warning: Import "yaml" could not be resolved from source (reportMissingModuleSource)
soynlp/soynlp/configs/config.py:25:53 - error: Argument of type "dict[Unknown, Unknown]" cannot be assigned to parameter "data" of type "Data" in function "from_dict"
"dict[Unknown, Unknown]" is incompatible with protocol "Data"
"keys" is an incompatible type
Type "() -> dict_keys[Unknown, Unknown]" is not assignable to type "() -> None"
Function return type "dict_keys[Unknown, Unknown]" is incompatible with type "None"
"dict_keys[Unknown, Unknown]" is not assignable to "None"
"__getitem__" is an incompatible type
Type "(key: Unknown, /) -> Unknown" is not assignable to type "(item: Unknown) -> None"
Missing keyword parameter "item"
... (reportArgumentType)
1 error, 1 warning, 0 informations
yaml.full_load(file) 가 반환하는 값의 타입이 dict[Unknown, Unknown] 으로 추론되기에 data_class 와 타입 불일치가 일어남. 이후에 해결하기 위해 임시로 pyright 체크 과정을 건너 띔
이로 인해 from_yaml 함수의 line 21 에서도 동일한 오류 발생
for task_config in config.pipeline: | ||
task_module = importlib.import_module("soynlp.pipeline.tasks") | ||
task_class: type[Task] = getattr(task_module, f"{task_config.name}Task") | ||
task_args = dacite.from_dict(data_class=task_class.args(), data=task_config.args) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/lovit/soynlp/pull/150/files#r1941706190 와 동일한 오류 발생. 임시로 무시함
resolve #149