-
Notifications
You must be signed in to change notification settings - Fork 97
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
Conversation
- Added SQL query to count datapoints per dataset - Added items count to dataset API response - Added Items column to datasets table in UI
There was a problem hiding this 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 in4
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 ofCOALESCE(dc.count, 0)
is unnecessary here because theLEFT JOIN
withdataset_counts
already ensures that datasets without datapoints will have a count of 0. You can directly usedc.count
. - Reason this comment was not posted:
Confidence changes required:50%
The SQL query inget_datasets_with_counts
is correct, but the use ofCOALESCE
is unnecessary since theLEFT JOIN
withdataset_counts
already ensures that datasets without datapoints will have a count of 0.
2. app-server/src/routes/datasets.rs:250
- Draft comment:
Theget_datasets
function is missing a route parameter forproject_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.
app-server/src/routes/datasets.rs
Outdated
@@ -244,6 +244,43 @@ async fn get_datapoints( | |||
Ok(HttpResponse::Ok().json(response)) | |||
} | |||
|
|||
#[get("datasets")] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done it
There was a problem hiding this 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
Closing in favour of #288 |
Important
Add item count column to datasets list by updating backend and frontend components.
get_datasets_with_counts()
indatasets.rs
to fetch datasets with item counts.get_datasets()
indatasets.rs
to useget_datasets_with_counts()
.get_datasets()
inroutes/datasets.rs
to includeitemsCount
in API response.itemsCount
toDataset
interface intypes.ts
.datasets.tsx
to display item counts.This description was created by
for d63d167. It will automatically update as commits are pushed.