Commit e5eec12
committed
Remove redundant upper_f initialization and None check
The initialization of upper_f = None and subsequent None check were unnecessary
because the if-elif-else chain guarantees that upper_f is always assigned to a
function before use:
- If df is DataFrame or str → upper_f = upper_f_dataframe
- If df is list of str → upper_f = upper_f_str_list
- If df is list of DataFrame → upper_f = upper_f_df_list
- Otherwise → raises TypeError (execution doesn't continue)
The final 'if upper_f is None' check at line 477-478 could never be True, and
the initialization only existed to silence a 'possibly unbound' warning.
Simplifies code logic without changing behavior.
Addresses reviewer feedback about unnecessary complexity.1 parent 681180c commit e5eec12
1 file changed
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | 337 | | |
341 | 338 | | |
342 | 339 | | |
| |||
472 | 469 | | |
473 | 470 | | |
474 | 471 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | 472 | | |
480 | 473 | | |
481 | 474 | | |
0 commit comments