Skip to content

Commit 0fe6ad3

Browse files
committed
Collapse the unit-switch gate to the one flag that decides it
currencyScaled is only ever written alongside currencyRepaired, so gating on both keys with opposite defaults was redundant and read as if the pair could disagree. One check, defaulting closed, is equivalent in every reachable state.
1 parent 1ac1130 commit 0fe6ad3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎yfinance/scrapers/history.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3665,8 +3665,7 @@ def map_signals_to_ranges(f, f_up, f_down):
36653665
logger.debug(f'Pruning range {df2.index[r[0]]}->{df2.index[r[1]-1]} because too old.', extra=log_extras)
36663666
del ranges[i]
36673667
if unit_switch and len(ranges) == 1 and ranges[0][1] == n \
3668-
and self._history_metadata.get('currencyRepaired', False) \
3669-
and self._history_metadata.get('currencyScaled', True):
3668+
and self._history_metadata.get('currencyScaled', False):
36703669
r = ranges[0]
36713670
m = split if r[2] == 'split' else split_rcp
36723671
if m < 0.99:

0 commit comments

Comments
 (0)