fix: Add runtime DeprecationWarnings to deprecated methods#145
Merged
jsonbailey merged 1 commit intomainfrom Apr 27, 2026
Merged
fix: Add runtime DeprecationWarnings to deprecated methods#145jsonbailey merged 1 commit intomainfrom
jsonbailey merged 1 commit intomainfrom
Conversation
Deprecated methods previously only noted their status in docstrings or via log.warning. They now emit warnings.warn(DeprecationWarning) so callers are notified at runtime, consistent with the parent launchdarkly-server-sdk pattern. Methods deprecated in client.py: config(), create_chat(), agent(), agents(). Method deprecated in tracker.py: track_openai_metrics(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11d17f1 to
a018c17
Compare
keelerm84
approved these changes
Apr 27, 2026
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
client.py:config(),create_chat(),agent(), andagents()were documented as deprecated in docstrings but emitted no runtime signal (create_chatusedlog.warninginstead). All four now emitwarnings.warn(..., DeprecationWarning, stacklevel=2).tracker.py:track_openai_metrics()now emits aDeprecationWarningpointing callers totrack_metrics_ofwithget_ai_metrics_from_responsefromldai_openai... deprecated:: Use :meth:Xinstead. This method will be removed in a future version.This is consistent with the pattern used in
launchdarkly-server-sdk.Test plan
test_tracker.pyupdated — bothtrack_openai_metricstests assertDeprecationWarningviapytest.warnstrack_bedrock_converse_metricsintentionally left unchanged (bedrock package planned separately)Closes AIC-1663
🤖 Generated with Claude Code
Note
Low Risk
Low risk: behavior is unchanged aside from emitting runtime
DeprecationWarnings, which may surface in caller test output or warning-as-error environments.Overview
Adds runtime
DeprecationWarnings (withstacklevel=2) to previously docstring-only deprecated APIs inLDAIClient(e.g.config,create_chat,agent,agents) and toLDAIConfigTracker.track_openai_metrics, replacing the prior log-only signal.Updates
test_tracker.pyto assert the new warning behavior viapytest.warnswhile keeping existing tracking semantics.Reviewed by Cursor Bugbot for commit a018c17. Bugbot is set up for automated code reviews on this repo. Configure here.