Skip to content

Commit 94b6d4b

Browse files
abrookinsclaude
andcommitted
Address Copilot code review feedback
- Add missing importlib.util import in data_migrator.py - Use type(None) instead of string comparison for type checking - Remove debug print statements from test files (security concern) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent de0a3d3 commit 94b6d4b

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

aredis_om/model/migrations/data_migrator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import abc
1010
import asyncio
1111
import importlib
12+
import importlib.util
1213
import os
1314
import time
1415
from datetime import datetime

aredis_om/model/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def convert_timestamp_to_datetime(obj, model_fields):
8989
non_none_types = [
9090
arg
9191
for arg in args
92-
if getattr(arg, "__name__", None) != "NoneType"
92+
if arg is not type(None)
9393
]
9494
if len(non_none_types) == 1:
9595
field_type = non_none_types[0]

tests/test_datetime_date_fix.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ async def test_hash_model_date_conversion():
4545
if isinstance(birth_date_value, bytes):
4646
birth_date_value = birth_date_value.decode("utf-8")
4747

48-
print(f"Stored value: {birth_date_value} (type: {type(birth_date_value)})")
49-
5048
# Should be able to parse as a float (timestamp)
5149
try:
5250
float(birth_date_value)
@@ -84,8 +82,6 @@ async def test_json_model_date_conversion():
8482
# The birth_date field should be stored as a timestamp (number)
8583
birth_date_value = raw_data.get("birth_date")
8684

87-
print(f"Stored value: {birth_date_value} (type: {type(birth_date_value)})")
88-
8985
assert isinstance(
9086
birth_date_value, (int, float)
9187
), f"Expected timestamp, got: {birth_date_value} ({type(birth_date_value)})"

0 commit comments

Comments
 (0)