Skip to content

Commit 2aa283a

Browse files
committed
Fix assert statements and update changelog
1 parent 37abaaf commit 2aa283a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

opentelemetry-operations-python

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 6358cf56263a875224c3db7fee79b40144866f15

util/opentelemetry-util-genai/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3795](#3795))
1616
- Make inputs / outputs / system instructions optional params to `on_completion`,
1717
([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3802](#3802)).
18-
- Use an crc32 checksum of the system instructions as it's upload filename, and check
18+
- Use a SHA256 hash of the system instructions as it's upload filename, and check
1919
if the file exists before re-uploading it, ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3814](#3814)).
2020

2121

util/opentelemetry-util-genai/tests/test_upload.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def test_lru_cache_works(self):
174174
)
175175
# Wait a bit for file upload to finish..
176176
time.sleep(0.5)
177-
assert record.attributes is not None
177+
self.assertIsNotNone(record.attributes)
178178
self.assertTrue(
179179
self.hook._file_exists(
180180
record.attributes["gen_ai.system_instructions_ref"]
@@ -213,7 +213,7 @@ def test_upload_when_inputs_outputs_empty(self):
213213
1,
214214
"should have uploaded 1 file",
215215
)
216-
assert record.attributes is not None
216+
self.assertIsNotNone(record.attributes)
217217
for ref_key in [
218218
"gen_ai.input.messages_ref",
219219
"gen_ai.output.messages_ref",
@@ -379,7 +379,7 @@ def test_system_insruction_is_hashed_to_avoid_reupload(self):
379379
with fsspec.open(expected_file_name, "wb") as file:
380380
file.write(b"asg")
381381
# FIle should exist.
382-
assert self.hook._file_exists(expected_file_name) is True
382+
self.assertTrue(self.hook._file_exists(expected_file_name))
383383
system_instructions = [
384384
types.Text(content="You are a helpful assistant."),
385385
types.Text(content="You will do your best."),
@@ -392,7 +392,7 @@ def test_system_insruction_is_hashed_to_avoid_reupload(self):
392392
log_record=record,
393393
)
394394
self.hook.shutdown()
395-
assert record.attributes is not None
395+
self.assertIsNotNone(record.attributes)
396396

397397
self.assertEqual(
398398
record.attributes["gen_ai.system_instructions_ref"],

0 commit comments

Comments
 (0)