-
Notifications
You must be signed in to change notification settings - Fork 602
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
opentelemetry-instrumentation-openai-v2: format test data for readability #2945
opentelemetry-instrumentation-openai-v2: format test data for readability #2945
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes:
- I changed failure assertions to be more precise as I had a test fail for the wrong reason.
- I intentionally didn't update the CHANGELOG as I thought it isn't worthwhile to end users.
- I noticed conventionally less doc strings and comments, but I retained the ones merged into the other project I did this to, as in developing I felt them helpful. That said, I'm happy to remove comments if that is more to style.
instrumentation/opentelemetry-instrumentation-openai-v2/tests/test_chat_completions.py
Outdated
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-openai-v2/tests/test_chat_completions.py
Outdated
Show resolved
Hide resolved
ps I can't do this, so let me know if you want this in the CHANGELOG |
p.s. is there any way to run ruff for instrumentation-openai-v2 as a part of |
Only changelog needs to be added. everything else looks good |
Thanks for the look @karthikscale3!
So the current changelog has adding the initial openai impl, do we think we should elaborate things like polish to that initial impl? If so, happy to update. If not, maybe we can add the label to skip this check (I don't have karma to) https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CHANGELOG.md#unreleased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a small nit this LGTM, recordings are way more readable.
instrumentation/opentelemetry-instrumentation-openai-v2/tests/conftest.py
Outdated
Show resolved
Hide resolved
Due to this refactor I've moved all genai related instrumentations under instrumentation-genai/ folder. Please rebase and the conflicts should be resolved :) |
thanks @codefromthecrypt for doing this, neat PR! |
…eral block scalar for readability Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
…conftest.py Co-authored-by: Riccardo Magliocchetti <[email protected]>
3c3c156
to
c9448c3
Compare
thanks for all the quick looks. rebased! |
Description
Before this change, test data was hard to compare visually with assertions due to format. It is easier to do pull request reviews if you can easily read the data. For example, changing to YAML block scalar format.
The upstream library has decided against custom serializers here. Instead, I used the same change I contributed to goose to solve this issue, which means fixture setup. While there is code visible to achieve this, I think it is worthwhile, and a change like this is better to do now vs later as test data accumulates.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I deleted the existing test data, exported my
OPENAI_API_KEY
and ran the following:Doing so recreated the data. Then, I unexported my
OPENAI_API_KEY
and re-ran to ensure the data was used.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.