yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

Fix malformed f-string in release `0.2.45`

Open FX196 opened this issue 1 year ago • 2 comments

Quick fix for issue https://github.com/ranaroussi/yfinance/issues/2093 This broke yfinance for me after I automatically upgraded to the latest release.

Existing tests should suffice. Directly targeting main because the release is broken

FX196 avatar Oct 21 '24 00:10 FX196

Just tried it on my system (macOS 15.1 / Python 3.11.9) and it works like a charm. Thanks for putting in the effort to address this issue.

fled-dev avatar Oct 21 '24 09:10 fled-dev

Hello good morning.

I am testing from databricks and it generates the same error:

Syntax error: string f: mismatch '(' (screener.py, line 101)

DavidVilem avatar Oct 21 '24 13:10 DavidVilem

I just tested against an image environment that failed tests from this error and this patch works:

pip install --force  git+https://github.com/FX196/yfinance@patch-1
python -c 'import yfinance'

Without the patch on the same image environment:

python -c 'import yfinance'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.11/site-packages/yfinance/__init__.py", line 30, in <module>
    from .screener.screener import Screener
  File "/opt/conda/lib/python3.11/site-packages/yfinance/screener/__init__.py", line 1, in <module>
    from .screener import Screener
  File "/opt/conda/lib/python3.11/site-packages/yfinance/screener/screener.py", line 101
    logger.error(f"Failed to get screener data for '{self._body.get('query', "query not set")}' reason: {e}")
                                                                              ^^^^^
SyntaxError: f-string: unmatched '('

vwbusguy avatar Oct 21 '24 16:10 vwbusguy