Skip to content

Commit 02f04a1

Browse files
committed
fix: address review comments (iteration #1)
1 parent 0fce373 commit 02f04a1

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

sagemaker-core/src/sagemaker/core/utils/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def pascal_to_snake(pascal_str):
273273

274274

275275
def is_not_primitive(obj):
276-
return not isinstance(obj, (int, float, str, bool, bytes, datetime.datetime))
276+
return not isinstance(obj, (int, float, str, bool, bytes, datetime.datetime))
277277

278278

279279
def is_not_str_dict(obj):
@@ -285,7 +285,7 @@ def is_primitive_list(obj):
285285

286286

287287
def is_primitive_class(cls):
288-
return cls in (str, int, bool, float, bytes, datetime.datetime)
288+
return cls in (str, int, bool, float, bytes, datetime.datetime)
289289

290290

291291
class Unassigned:

sagemaker-core/tests/unit/generated/test_utils.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,29 +374,20 @@ def test_serialize_method_nested_shape():
374374

375375

376376

377-
def test_serialize_with_bytes_value_returns_bytes():
378-
result = serialize(b'1')
379-
assert result == b'1'
380-
381-
382-
def test_serialize_dict_with_bytes_value_returns_dict_with_bytes():
377+
def test_serialize_bytes_returns_bytes():
383378
result = serialize({'body': b'1'})
384379
assert result == {'body': b'1'}
380+
assert serialize(b'hello') == b'hello'
385381

386382

387-
def test_is_not_primitive_with_bytes_returns_false():
388-
assert is_not_primitive(b'hello') is False
383+
def test_is_not_primitive_with_bytes():
384+
assert is_not_primitive(b'test') is False
389385

390386

391-
def test_is_primitive_class_with_bytes_returns_true():
387+
def test_is_primitive_class_with_bytes():
392388
assert is_primitive_class(bytes) is True
393389

394390

395-
def test_serialize_list_with_bytes_elements():
396-
result = serialize([b'a', b'b'])
397-
assert result == [b'a', b'b']
398-
399-
400391
class TestUnassignedBehavior:
401392
"""Test Unassigned class methods for proper behavior.
402393

0 commit comments

Comments
 (0)