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

feat: add items count column to datasets list #276

Closed
wants to merge 2 commits into from

Conversation

raj921
Copy link

@raj921 raj921 commented Dec 8, 2024

  • Added SQL query to count datapoints per dataset
  • Added items count to dataset API response
  • Added Items column to datasets table in UI

Important

Add item count column to datasets list by updating backend and frontend components.

  • Backend:
    • Added get_datasets_with_counts() in datasets.rs to fetch datasets with item counts.
    • Updated get_datasets() in datasets.rs to use get_datasets_with_counts().
    • Modified get_datasets() in routes/datasets.rs to include itemsCount in API response.
  • Frontend:
    • Added itemsCount to Dataset interface in types.ts.
    • Added "Items" column to datasets table in datasets.tsx to display item counts.

This description was created by Ellipsis for d63d167. It will automatically update as commits are pushed.

- Added SQL query to count datapoints per dataset
- Added items count to dataset API response
- Added Items column to datasets table in UI
@CLAassistant
Copy link

CLAassistant commented Dec 8, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to d63d167 in 1 minute and 17 seconds

More details
  • Looked at 135 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. app-server/src/db/datasets.rs:82
  • Draft comment:
    The use of COALESCE(dc.count, 0) is unnecessary here because the LEFT JOIN with dataset_counts already ensures that datasets without datapoints will have a count of 0. You can directly use dc.count.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The SQL query in get_datasets_with_counts is correct, but the use of COALESCE is unnecessary since the LEFT JOIN with dataset_counts already ensures that datasets without datapoints will have a count of 0.
2. app-server/src/routes/datasets.rs:250
  • Draft comment:
    The get_datasets function is missing a route parameter for project_id. The path should be #[get("projects/{project_id}/datasets")] to match the SQL query requirements.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_QKxjfwVn4zAh8297


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -244,6 +244,43 @@ async fn get_datapoints(
Ok(HttpResponse::Ok().json(response))
}

#[get("datasets")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_datasets function is missing a route parameter for project_id. The path should be #[get("projects/{project_id}/datasets")] to match the SQL query requirements.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done it

Copy link
Member

@dinmukhamedm dinmukhamedm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @raj921! Thanks for your PR! This looks good, but I think we actually fetch datasets from the frontend using drizzle, so there was no need to alter this in app-server. You should probably modify https://github.com/lmnr-ai/lmnr/blob/main/frontend/app/api/projects/%5BprojectId%5D/datasets/route.ts#L34 instead

@dinmukhamedm
Copy link
Member

Closing in favour of #288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants