diff --git a/mars/services/task/supervisor/processor.py b/mars/services/task/supervisor/processor.py index 58cfe00aba..c8afcf2bb9 100644 --- a/mars/services/task/supervisor/processor.py +++ b/mars/services/task/supervisor/processor.py @@ -599,11 +599,17 @@ def get_tileable_details(self): else: status = SubtaskStatus.running + props = {slot: getattr(tileable, slot, None) for slot in tileable.__slots__} + props = {k: v for k, v in props.get('_FIELD_VALUES').items() + if k != 'key' and isinstance(v, (int, float, str))} + tileable_infos[tileable.key] = { 'progress': progress, 'subtaskCount': len(results), 'status': status.value, + 'properties': props, } + return tileable_infos def get_tileable_subtasks(self, tileable_id: str, with_input_output: bool): diff --git a/mars/services/task/tests/test_service.py b/mars/services/task/tests/test_service.py index dbcd279ee3..60777e6537 100644 --- a/mars/services/task/tests/test_service.py +++ b/mars/services/task/tests/test_service.py @@ -384,6 +384,17 @@ def _get_fields(details, field, wrapper=None): details = await task_api.get_tileable_details(task_id) assert details[r7.key]['status'] == SubtaskStatus.errored.value + contain_id_property = False + for tileable in details.keys(): + for property_key, property_value in details.get(tileable).get('properties').items(): + assert property_key != 'key' + assert isinstance(property_value, (int, float, str)) + + if property_key == 'id': + contain_id_property = True + + assert contain_id_property == True + @pytest.mark.asyncio @pytest.mark.parametrize('with_input_output', [False, True])