Skip to content
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

[data][dashboard] fix confusing dataset operator name #48805

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
24 changes: 18 additions & 6 deletions python/ray/dashboard/modules/data/tests/test_data_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
] + DATA_SCHEMA

OPERATOR_SCHEMA = [
"name",
"operator",
] + DATA_SCHEMA

Expand Down Expand Up @@ -64,12 +65,23 @@ def test_get_datasets():
operators = dataset["operators"]
assert len(operators) == 2
op0 = operators[0]
op1 = operators[1]
assert sorted(op0.keys()) == sorted(OPERATOR_SCHEMA)
assert op0["operator"] == "Input0"
assert op0["progress"] == 20
assert op0["total"] == 20
assert op0["state"] == "FINISHED"
assert operators[1]["operator"] == "ReadRange->MapBatches(<lambda>)1"
assert sorted(op1.keys()) == sorted(OPERATOR_SCHEMA)
assert {
"operator": "Input0",
"name": "Input",
"state": "FINISHED",
"progress": 20,
"total": 20,
}.items() <= op0.items()
assert {
"operator": "ReadRange->MapBatches(<lambda>)1",
"name": "ReadRange->MapBatches(<lambda>)",
"state": "FINISHED",
"progress": 20,
"total": 20,
}.items() <= op1.items()

ds.map_batches(lambda x: x).materialize()
data = requests.get(DATA_HEAD_URLS["GET"].format(job_id=job_id)).json()
Expand All @@ -83,4 +95,4 @@ def test_get_datasets():


if __name__ == "__main__":
sys.exit(pytest.main(["-v", __file__]))
sys.exit(pytest.main(["-vv", __file__]))
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