Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] pypi.org hosted fastquant 0.1.8.1 breaks due to json_normalize (fix already in master) #423

Open
icasimpan opened this issue Jun 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@icasimpan
Copy link

Problem description

More of an issue with the version in pypi.org than a current bug, already fixed in commit df6d605

Example

from fastquant import get_pse_data, backtest
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/icasimpan/code/isolate/env/lib/python3.11/site-packages/fastquant/__init__.py", line 2, in <module>
    from .disclosures import *
  File "/home/icasimpan/code/isolate/env/lib/python3.11/site-packages/fastquant/disclosures/__init__.py", line 4, in <module>
    from fastquant.disclosures.pse import DisclosuresPSE
  File "/home/icasimpan/code/isolate/env/lib/python3.11/site-packages/fastquant/disclosures/pse.py", line 24, in <module>
    from pandas.io.json import json_normalize
ImportError: cannot import name 'json_normalize' from 'pandas.io.json' (/home/icasimpan/code/isolate/env/lib/python3.11/site-packages/pandas/io/json/__init__.py)

Expected behavior

It's not supposed to break. Fixed the issue same as what was done in df6d605 and the module worked fine.

Workaround

Simply install using the master branch instead of using pypi version:

git clone git@github.com:enzoampil/fastquant.git
python -m pip install -e ./fastquant

Environment

  • platform (e.g. Linux):
  • fastquant version (e.g. 0.1.8.1)
  • installation method: pip
@icasimpan icasimpan added the bug Something isn't working label Jun 28, 2023
@icasimpan icasimpan changed the title [BUG] pypi.org hosted fastquant 0.1.8.1 breaks due to json_normalize (fixed in master) [BUG] pypi.org hosted fastquant 0.1.8.1 breaks due to json_normalize (fix already in master) Jun 28, 2023
@jjjrmy
Copy link

jjjrmy commented Sep 20, 2023

after you use the workaround, I am getting error ImportError: cannot import name 'backtest' from 'fastquant' (unknown location)

Any suggestions?

@kbalsamy
Copy link

after you use the workaround, I am getting error ImportError: cannot import name 'backtest' from 'fastquant' (unknown location)

Any suggestions?

just restart the kernel. it will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants