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

Simpler evaluations part 1.3 #515

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Simpler evaluations part 1.3 #515

merged 1 commit into from
Oct 29, 2024

Conversation

csansoon
Copy link
Contributor

@csansoon csansoon commented Oct 28, 2024

Part 1.3
Perform the migration to move all configuration data from evaluations to evaluationMetadataLlmAsJudgeLegacy.

@csansoon csansoon changed the base branch from main to simpler_evaluations_part_1.2 October 28, 2024 15:34
andresgutgon
andresgutgon previously approved these changes Oct 28, 2024
Base automatically changed from simpler_evaluations_part_1.2 to main October 29, 2024 08:40
@csansoon csansoon dismissed andresgutgon’s stale review October 29, 2024 08:40

The base branch was changed.

@csansoon csansoon force-pushed the simpler_evaluations_part_1.3 branch 2 times, most recently from 5c3321b to b89c5c6 Compare October 29, 2024 08:52
@csansoon csansoon force-pushed the simpler_evaluations_part_1.3 branch from b89c5c6 to 205a627 Compare October 29, 2024 08:58
@csansoon csansoon force-pushed the simpler_evaluations_part_1.3 branch from 205a627 to c8d0d36 Compare October 29, 2024 08:58
Comment on lines +1 to +11
--- Migrate configuration column from "evaluations" to "llm_as_judge_evaluation_metadatas"
UPDATE "latitude"."llm_as_judge_evaluation_metadatas"
SET "configuration" = "latitude"."evaluations"."configuration"
FROM "latitude"."evaluations"
WHERE "latitude"."evaluations"."metadata_id" = "latitude"."llm_as_judge_evaluation_metadatas"."id";--> statement-breakpoint

--- Remove evaluation metadatas with NULL configuratios (these are llm_as_judge_evaluation_metadatas rows that were left when removing the original evaluation)
DELETE FROM "latitude"."llm_as_judge_evaluation_metadatas" WHERE "latitude"."llm_as_judge_evaluation_metadatas"."configuration" IS NULL--> statement-breakpoint

--- Set configuration column as NOT NULL
ALTER TABLE "latitude"."llm_as_judge_evaluation_metadatas" ALTER COLUMN "configuration" SET NOT NULL;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving configuration from evaluations to llm_as_judge_evaluation_metadatas, and then removing the llm_as_judge_evaluation_metadatas that were left over after removing their original evaluations

@@ -58,7 +58,7 @@ export type LlmAsJudgeEvaluationMetadata = InferSelectModel<
export type Subscription = InferSelectModel<typeof subscriptions>

export type EvaluationDto = Evaluation & {
configuration?: LlmAsJudgeEvaluationMetadata['configuration']
configuration: LlmAsJudgeEvaluationMetadata['configuration'] | null
Copy link
Collaborator

Choose a reason for hiding this comment

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

why the null? isn't it supposed to be not null after your migration ☝🏼 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the original configuration attribute from the evaluations, not the new one in the LegacyMetadata, so technically every value should be Null here now. This is just for compatibility while I'm doing changes and will be removed in the future.

@csansoon csansoon merged commit f8f2027 into main Oct 29, 2024
3 checks passed
@csansoon csansoon deleted the simpler_evaluations_part_1.3 branch October 29, 2024 09:11
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants