Skip to content

Commit

Permalink
Clean up whether to show YF progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
edtechre committed May 9, 2024
1 parent d1cea16 commit 425a77d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/pybroker/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,15 @@ def _fetch_data(
_adjust: Optional[str],
) -> pd.DataFrame:
""":meta private:"""
yf_progress_bar_flag = not (
self._logger._disabled or self._logger.progress_bar_disabled
show_yf_progress_bar = (
not self._logger._disabled
and not self._logger._progress_bar_disabled
)
df = yfinance.download(
list(symbols),
start=start_date,
end=end_date,
progress=yf_progress_bar_flag,
progress=show_yf_progress_bar,
)
if df.columns.empty:
return pd.DataFrame(
Expand Down
5 changes: 0 additions & 5 deletions src/pybroker/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ def _update_progress_bar(self, count: int):
self._progress_bar = None
self._out("")

@property
def progress_bar_disabled(self):
"""Disables Progress Bar flag"""
return self._progress_bar_disabled

def disable(self):
"""Disables logging."""
self._disabled = True
Expand Down

0 comments on commit 425a77d

Please sign in to comment.