[BUG] create_task() hardcodes task_type="None" instead of inferring type string from TaskType
维护者通常 2 天内回复
评估
调研方向
从 openml/tasks/functions.py 中第 575 行附近的 create_task() 开始,然后阅读 TaskType 值如何映射到规范名称。检查 tests/test_runs/test_run.py 中第 290 行附近的任务类型比较,并添加或更新回归测试。完成的标准是:本地创建的任务显示预期的规范任务类型字符串,而不是 "None"。
由索引模型根据 Issue 内容生成。
描述
Description
When creating an OpenML task locally using openml.tasks.create_task(), the task object is initialized with task_type="None".
In openml/tasks/functions.py:575, the function hardcodes this placeholder string literal:
return task_cls(
task_id=None,
task_type_id=task_type,
task_type="None", # TODO: refactor to get task type string from ID.
data_set_id=dataset_id,
target_name=target_name,
estimation_procedure_id=estimation_procedure_id,
evaluation_measure=evaluation_measure,
**kwargs,
)
Because of this, task.task_type is literally the string "None" rather than the canonical task type name (e.g., "Supervised Classification", "Supervised Regression", "Clustering", "Learning Curve").
This causes:
Equality checks like if task.task_type == "Supervised Classification" (used in client code and in tests/test_runs/test_run.py:290) to evaluate to False.
Error messages and representations to display Task type 'None' (such as in openml/tasks/task.py:315).
Steps/Code to Reproduce
python
import openml
from openml.tasks import TaskType, create_task
task = create_task(
TaskType.SUPERVISED_CLASSIFICATION,
dataset_id=1,
target_name="class",
estimation_procedure_id=1,
)
print("task.task_type:", repr(task.task_type))
print("Is Supervised Classification?", task.task_type == "Supervised Classification")
Expected Results
task.task_type should be "Supervised Classification", and task.task_type == "Supervised Classification" should evaluate to True.
Actual Results
task.task_type: 'None'
Is Supervised Classification? False
Versions
OpenML: 0.16.0
Python: 3.10+
OS: Windows / Linux / macOS
- 主要语言
- Python
- 星标
- 366
- 派生
- 306
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openml/openml-python 的其他 Issue
-
Enhancement: Add missing **kwargs support to list_setups and list_evaluations可能已有人在做 @shellyco-code 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
openml/openml-python#1753 · 1 条评论 ·
维护者通常 2 天内回复
-
[ENH] list_estimation_procedures() should include the procedure IDs可能已有人在做 @Jayant-kernel 于 14 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
openml/openml-python#1750 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[DOC] Update documentation for running tests with local services可能已有人在做 @nishtha-agarwal-211 于 214 天前认领。 未关闭Documentation Good First Issue
难度 2/5 1-3 小时 新手友好度 74/100
openml/openml-python#1708 · 8 条评论 ·
维护者通常 2 天内回复
-
[MNT] Add Missing Assertions to Run Function Tests可能已有人在做 @Akarshkushwaha 于 233 天前认领。 未关闭Good First Issue module:Run testing
难度 2/5 1-3 小时 新手友好度 82/100
openml/openml-python#1646 · 9 条评论 · 3 个 reaction ·
维护者通常 2 天内回复
-
[MNT] Complete Test for Sparse Dataset Row ID and Ignore Attributes Inclusion可能已有人在做 @omkar-334 于 233 天前认领。 未关闭Good First Issue module:Data testing
难度 2/5 1-3 小时 新手友好度 82/100
openml/openml-python#1644 · 4 条评论 ·
维护者通常 2 天内回复
查看 openml/openml-python 的全部 Issue
相似的 Issue
-
dependencies feature github_actions good first issue
难度 2/5 1-3 小时 新手友好度 62/100
wemake-services/wemake-django-template#3149 ·
维护者通常 1 天内回复
-
upstream update
难度 2/5 1-3 小时 新手友好度 65/100
conan-io/conan-center-index#31142 ·
维护者通常 1 天内回复
-
area:core bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
request-theme
难度 2/5 1 小时以内 新手友好度 70/100
LizardByte/ThemerrDB#8877 · 1 条评论 ·
维护者通常 1 天内回复
-
area/install-update comp/gateway P0 sweeper:risk-compatibility type/bug
难度 2/5 1 小时以内 新手友好度 72/100
NousResearch/hermes-agent#135997 · 3 条评论 ·
维护者通常 1 天内回复