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

truncate data in datapoints and eval-datapoints #293

Merged
merged 2 commits into from
Dec 27, 2024
Merged

Conversation

dinmukhamedm
Copy link
Member

@dinmukhamedm dinmukhamedm commented Dec 27, 2024

Important

Truncate data and target fields to 100 characters in both backend and frontend for consistent data handling.

  • Backend Changes:
    • Truncate data and target fields to 100 characters in get_datapoints() in datapoints.rs.
    • Change data and target types from Value to String in DatapointView in datapoints.rs.
  • Frontend API Changes:
    • Truncate data and target fields to 100 characters in GET requests in route.ts for evaluations.
  • Frontend Component Changes:
    • Use useSWR to fetch datapoint data in dataset-panel.tsx.
    • Update DatasetPanel to handle datapointId instead of full datapoint object in dataset.tsx.

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

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 7d84d0a in 1 minute and 28 seconds

More details
  • Looked at 223 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. app-server/src/db/datapoints.rs:16
  • Draft comment:
    Ensure that the data and target fields are correctly handled as String in the insert_datapoints function to avoid type mismatches.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. frontend/app/api/projects/[projectId]/datasets/[datasetId]/datapoints/[datapointId]/route.ts:27
  • Draft comment:
    Consider handling the case where datapoint is not found to prevent unexpected behavior.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The GET method in route.ts does not handle the case where datapoint is not found, which could lead to unexpected behavior.
3. frontend/app/api/projects/[projectId]/evaluations/[evaluationId]/route.ts:42
  • Draft comment:
    Use SUBSTRING(data::text, 1, 100) instead of SUBSTRING(data::text, 0, 100) to include the first character in the substring. This issue is also present in page.tsx.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_1RJb6AlkAmWZpUrG


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.

Use SUBSTRING(data::text, 1, 100) instead of SUBSTRING(data::text, 0, 100) to include the first character in the substring.

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.

👍 Looks good to me! Incremental review on 0a41982 in 14 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/components/dataset/dataset-panel.tsx:103
  • Draft comment:
    Consider initializing newData, newTarget, and newMetadata with useState directly using datapoint?.data, datapoint?.target, and datapoint?.metadata respectively, instead of setting them in a useEffect. This can simplify the code and ensure that the initial state is consistent with the fetched data.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of useSWR is correct, but the datapoint state initialization could be improved for consistency.

Workflow ID: wflow_ntTYG6brysURqS0f


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@dinmukhamedm dinmukhamedm merged commit 247fc66 into dev Dec 27, 2024
2 checks passed
@dinmukhamedm dinmukhamedm deleted the truncate-data branch December 27, 2024 11:59
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