diff --git a/mars/services/task/supervisor/processor.py b/mars/services/task/supervisor/processor.py index bbd1d4437c..c8afcf2bb9 100644 --- a/mars/services/task/supervisor/processor.py +++ b/mars/services/task/supervisor/processor.py @@ -599,27 +599,15 @@ def get_tileable_details(self): else: status = SubtaskStatus.running - # get properties for tileable - all_propertes = {} - for slot in tileable.__slots__: - all_propertes.update(getattr(tileable, slot, None)) - - # Only int/float/string type values for now - displayed_properties = dict() - for property_key, property_value in all_propertes.items(): - # Omit key property - if (property_key == 'key'): - continue - - if isinstance(property_value, int) or isinstance(property_value, float) \ - or isinstance(property_value, str): - displayed_properties[property_key] = property_value + 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': displayed_properties, + 'properties': props, } return tileable_infos diff --git a/mars/services/task/tests/test_service.py b/mars/services/task/tests/test_service.py index 4c33659865..1182a7cb37 100644 --- a/mars/services/task/tests/test_service.py +++ b/mars/services/task/tests/test_service.py @@ -384,27 +384,6 @@ def _get_fields(details, field, wrapper=None): details = await task_api.get_tileable_details(task_id) assert details[r7.key]['status'] == SubtaskStatus.errored.value - def a(): - return md.DataFrame([[1, 2], [3, 4]]) - - def b(): - return md.DataFrame([[1, 2, 3, 4], [4, 3, 2, 1]]) - - def c(a, b): - return a.sum() * a.product() * b.sum() * a.sum() / a.sum() * b.product() / a.product() - - ra = mr.spawn(a) - rb = mr.spawn(b) - rc = mr.spawn(c, args=(ra, rb)) - - graph = TileableGraph([rc.data]) - next(TileableGraphBuilder(graph).build()) - - task_id = await task_api.submit_tileable_graph(graph, fuse_enabled=False) - - await asyncio.sleep(1) - details = await task_api.get_tileable_details(task_id) - def is_valid_type(value): return isinstance(value, int) or isinstance(value, float) or isinstance(value, str)