Skip to content

Commit 6f56fea

Browse files
committed
fix potential edge case in handle_aliased_column method
1 parent 323ff76 commit 6f56fea

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

manage_breast_screening/notifications/management/commands/create_appointments.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,8 @@ def workflow_action_date_and_time(self, timestamp: str) -> datetime:
172172

173173
def handle_aliased_column(
174174
self, expected_name: str, fallback_name: str, row: pandas.Series
175-
) -> str | None:
176-
if expected_name in row:
177-
return row[expected_name]
178-
elif fallback_name in row:
179-
return row[fallback_name]
180-
return None
175+
) -> object:
176+
return row.get(expected_name, row.get(fallback_name))
181177

182178
def appointment_date_and_time(self, row: pandas.Series) -> datetime:
183179
dt = datetime.strptime(

0 commit comments

Comments
 (0)