Skip to content

Commit

Permalink
Fix _get_ticker_tz() args, were being swapped. Improce its unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueRaider committed Dec 17, 2023
1 parent 281cc64 commit 3c580f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_getTz(self):

# Test:
dat = yf.Ticker(tkr, session=self.session)
tz = dat._get_ticker_tz(proxy=None, timeout=None)
tz = dat._get_ticker_tz(proxy=None, timeout=5)

self.assertIsNotNone(tz)

Expand Down
4 changes: 2 additions & 2 deletions yfinance/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ def map_signals_to_ranges(f, f_up, f_down):

return df2

def _get_ticker_tz(self,timeout, proxy=None):
def _get_ticker_tz(self, proxy, timeout):
proxy = proxy or self.proxy
if self._tz is not None:
return self._tz
Expand All @@ -1675,7 +1675,7 @@ def _get_ticker_tz(self,timeout, proxy=None):
return tz

@utils.log_indent_decorator
def _fetch_ticker_tz(self, timeout, proxy=None):
def _fetch_ticker_tz(self, proxy, timeout):
# Query Yahoo for fast price data just to get returned timezone
proxy = proxy or self.proxy
logger = utils.get_yf_logger()
Expand Down

0 comments on commit 3c580f7

Please sign in to comment.