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

datapoint count and truncate data #294

Merged
merged 2 commits into from
Dec 27, 2024
Merged

datapoint count and truncate data #294

merged 2 commits into from
Dec 27, 2024

Conversation

dinmukhamedm
Copy link
Member

@dinmukhamedm dinmukhamedm commented Dec 27, 2024

Important

This PR truncates data and target fields to 100 characters, adds datapoint counting, and updates frontend components to handle these changes.

  • Backend Changes:
    • In datapoints.rs, change data and target fields in DatapointView from Value to String.
    • Truncate data and target to 100 characters in get_datapoints().
    • Add count_datapoints() function to count datapoints in datapoints.rs.
  • Frontend API:
    • Add GET method in route.ts to fetch a single datapoint by ID.
    • Modify GET in datasets/route.ts to include datapointsCount.
  • Frontend Components:
    • Update DatasetPanel to fetch and display datapoint details using swr.
    • Modify datasets.tsx to display datapointsCount in datasets table.
    • Update dataset.tsx to handle datapoint selection and display in DatasetPanel.

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

devansh-m12 and others added 2 commits December 27, 2024 16:18
* eval time progression (#210)

* initial work to compare evals

* remove unnecessary div

* design

---------

Co-authored-by: Din <[email protected]>

* added datapoint count on dataset table

* added types and empty check

---------

Co-authored-by: Dinmukhamed Mailibay <[email protected]>
Co-authored-by: skull8888888 <[email protected]>
Co-authored-by: Din <[email protected]>
* truncate data in datapoints and eval-datapoints

* added skeleton

---------

Co-authored-by: Robert Kim <[email protected]>
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 247fc66 in 1 minute and 35 seconds

More details
  • Looked at 341 lines of code in 10 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. app-server/src/db/datapoints.rs:16
  • Draft comment:
    Changing data and target from Value to String in DatapointView may lead to issues if the database still stores these fields as JSON. Ensure that the database schema and related logic are updated to reflect this change.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. frontend/app/api/projects/[projectId]/datasets/route.ts:55
  • Draft comment:
    Ensure that the datapointsCount field is correctly calculated and included in the dataset response. This field should accurately reflect the number of datapoints associated with each dataset.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. frontend/app/api/projects/[projectId]/evaluations/[evaluationId]/route.ts:42
  • Draft comment:
    The SUBSTRING function in SQL should start from index 1, not 0. Update the query to SUBSTRING(data::text, 1, 100) and SUBSTRING(target::text, 1, 100) to correctly truncate the data and target fields.
  • Reason this comment was not posted:
    Marked as duplicate.
4. frontend/app/project/[projectId]/evaluations/[evaluationId]/page.tsx:73
  • Draft comment:
    The SUBSTRING function in SQL should start from index 1, not 0. Update the query to SUBSTRING(data::text, 1, 100) and SUBSTRING(target::text, 1, 100) to correctly truncate the data and target fields.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_5FnFREkTxU6x7oQ1


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.

"SELECT
id,
dataset_id,
SUBSTRING(data::text, 0, 100) as data,
Copy link
Contributor

Choose a reason for hiding this comment

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

The SUBSTRING function in SQL should start from index 1, not 0. Update the query to SUBSTRING(data::text, 1, 100) and SUBSTRING(target::text, 1, 100) to correctly truncate the data and target fields.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fine in postgres

@@ -7,6 +7,26 @@ import { db } from '@/lib/db/drizzle';
import { datasetDatapoints } from '@/lib/db/migrations/schema';
import { fetcher } from '@/lib/utils';

export async function GET(
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding authentication and authorization checks in the GET method to ensure that only authorized users can access the datapoint data.

Copy link
Member Author

Choose a reason for hiding this comment

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

Handled in middleware

@dinmukhamedm dinmukhamedm merged commit 502c895 into main Dec 27, 2024
2 checks passed
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.

2 participants