fix: backport #254 — auto-infer is_evaluation when dataset_id, datapoint_id, and run_id are all defined#267
Merged
Conversation
…id are all defined When all three evaluation identifiers (run_id, dataset_id, datapoint_id) are present, automatically set is_evaluation=True so users don't need to pass it explicitly. This prevents session lifecycle issues where evaluation context was not propagated because the flag was missing. Co-Authored-By: unknown <>
Co-Authored-By: unknown <>
Ensures _setup_evaluation_context_dynamically reads the correct is_evaluation value from config after auto-inference. Co-Authored-By: unknown <>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
|
integration tests are already in broken state on base branch, ignoring the failure here... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #254 from
federated-sdk-release-candidatetolegacy-sdk.When users pass
dataset_id,datapoint_id, andrun_idto the tracer but forgetis_evaluation=True, evaluation context (baggage propagation, session metadata, source defaulting to"evaluation") is silently skipped. This causes session lifecycle issues where sessions are overwritten between experiment and tracer instances.This adds inference logic in
_initialize_core_attributes()that auto-setsis_evaluation=Truewhen all three evaluation identifiers are present. Bothself.is_evaluationandconfig["is_evaluation"]are updated together so that_setup_evaluation_context_dynamically(config)receives the correct value downstream.Review & Testing Checklist for Human
is_evaluation=Falseoverride: The check usesnot self.is_evaluation, which cannot distinguish between the Pydantic defaultFalseand an explicitis_evaluation=Falsefrom the user. If a user passes all three IDs alongside explicitis_evaluation=False, inference will override it toTrue. Confirm this edge case is acceptable onlegacy-sdk._setup_evaluation_context_dynamically(config)onlegacy-sdkreadsconfig["is_evaluation"]the same way as onfederated-sdk-release-candidate, so the config sync fix is actually needed and correct here.is_evaluation=True) and asserts evaluation mode is inferred.Notes