Skip to content

Commit e301f54

Browse files
committed
chore: fix quality checks
1 parent 27ce630 commit e301f54

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

openedx_events/event_bus/avro/schema.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,13 @@ def _get_avro_type_for_dict_item(
173173
# Case 3: Unannotated containers (raise specific errors)
174174
if value_type is dict:
175175
raise TypeError("A Dictionary as a dictionary value should have a type annotation.")
176-
elif value_type is list:
176+
if value_type is list:
177177
raise TypeError("A List as a dictionary value should have a type annotation.")
178178

179179
# Case 4: Unsupported types
180180
raise TypeError(f"Type {value_type} is not supported for dict values.")
181181

182+
182183
def _get_avro_type_for_list_item(
183184
data_type: Type[list], previously_seen_types: set, type_overrides: dict[Any, str]
184185
) -> str | dict[str, str]:
@@ -236,7 +237,7 @@ def _get_avro_type_for_list_item(
236237
# Case 3: Unannotated containers (raise specific errors)
237238
if item_type is dict:
238239
raise TypeError("A Dictionary as a list item should have a type annotation.")
239-
elif item_type is list:
240+
if item_type is list:
240241
raise TypeError("A List as a list item should have a type annotation.")
241242

242243
# Case 4: Unsupported types

openedx_events/event_bus/avro/tests/test_avro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def process_type(type_spec: Any) -> Any:
126126
dict, or list
127127
128128
Returns:
129-
An appropriate test value for the specified type
129+
Any: An appropriate test value for the specified type
130130
"""
131131
# Primitive types like string, long, boolean, etc.
132132
if isinstance(type_spec, str):
@@ -321,7 +321,7 @@ def generate_test_event_data_for_data_type(data_type: Any) -> dict: # pragma: n
321321
attr_data = generate_test_event_data_for_data_type(attribute.type)
322322
data_dict.update({attribute.name: attr_data})
323323

324-
return data_type(**data_dict)
324+
return data_type(**data_dict)
325325

326326

327327
def generate_test_data_for_signal(signal: OpenEdxPublicSignal) -> dict:

0 commit comments

Comments
 (0)