Skip to content

Commit

Permalink
[data][dashboard] fix confusing dataset operator name
Browse files Browse the repository at this point in the history
Signed-off-by: can <can@anyscale.com>
  • Loading branch information
can-anyscale committed Nov 21, 2024
1 parent d4476ac commit 9375e24
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const DataRow = ({
</TableCell>
<TableCell align="left">
{isDatasetRow && datasetMetrics.dataset}
{isOperatorRow && operatorMetrics.operator}
{isOperatorRow && operatorMetrics.name}
</TableCell>
<TableCell align="right" style={{ width: 200 }}>
<TaskProgressBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe("DataOverview", () => {
operators: [
{
operator: "test_ds1_op1",
name: "test_ds1_op",
state: "RUNNING",
progress: 99,
total: 101,
Expand Down Expand Up @@ -104,11 +105,11 @@ describe("DataOverview", () => {
expect(screen.getByText("70/80")).toBeVisible();

// Operator dropdown
expect(screen.queryByText("test_ds1_op1")).toBeNull();
expect(screen.queryByText("test_ds1_op")).toBeNull();
await user.click(screen.getByTitle("Expand Dataset test_ds1"));
expect(screen.getByText("test_ds1_op1")).toBeVisible();
expect(screen.getByText("test_ds1_op")).toBeVisible();
await user.click(screen.getByTitle("Collapse Dataset test_ds1"));
expect(screen.queryByText("test_ds1_op1")).toBeNull();
expect(screen.queryByText("test_ds1_op")).toBeNull();

// Second Dataset
expect(screen.getByText("test_ds2")).toBeVisible();
Expand Down
1 change: 1 addition & 0 deletions python/ray/dashboard/client/src/type/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type DatasetMetrics = DataMetrics & {

export type OperatorMetrics = DataMetrics & {
operator: string;
name: string;
};

export type DataMetrics = {
Expand Down
2 changes: 2 additions & 0 deletions python/ray/dashboard/modules/data/tests/test_data_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
DATA_HEAD_URLS = {"GET": "http://localhost:8265/api/data/datasets/{job_id}"}

DATA_SCHEMA = [
"name",
"state",
"progress",
"total",
Expand Down Expand Up @@ -66,6 +67,7 @@ def test_get_datasets():
op0 = operators[0]
assert sorted(op0.keys()) == sorted(OPERATOR_SCHEMA)
assert op0["operator"] == "Input0"
assert op0["name"] == "Input"
assert op0["progress"] == 20
assert op0["total"] == 20
assert op0["state"] == "FINISHED"
Expand Down
1 change: 1 addition & 0 deletions python/ray/data/_internal/execution/streaming_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ def _get_state_dict(self, state):
"end_time": time.time() if state != "RUNNING" else None,
"operators": {
f"{op.name}{i}": {
"name": op.name,
"progress": op_state.num_completed_tasks,
"total": op.num_outputs_total(),
"state": state,
Expand Down
1 change: 1 addition & 0 deletions python/ray/data/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,7 @@ def test_stats_actor_datasets(ray_start_cluster):
assert "Input0" in operators
assert "ReadRange->MapBatches(<lambda>)1" in operators
for value in operators.values():
assert value["name"] in ["Input", "ReadRange->MapBatches(<lambda>)"]
assert value["progress"] == 20
assert value["total"] == 20
assert value["state"] == "FINISHED"
Expand Down

0 comments on commit 9375e24

Please sign in to comment.