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

Calling parse_fp() in v0.5.1 results in "AttributeError: '_thread._local' object has no attribute 'thrift_cache'" #281

Open
rlratzel opened this issue Jun 26, 2024 · 5 comments · Fixed by #284

Comments

@rlratzel
Copy link

After installing thriftpy2 0.5.1, the following traceback was encountered when calling parse_fp():

...
 /opt/conda/envs/test/lib/python3.9/site-packages/cugraph_service_client/cugraph_service_thrift.py:262: in <module>
    spec = thriftpy2.load_fp(io.StringIO(cugraph_thrift_spec), module_name="cugraph_thrift")
/opt/conda/envs/test/lib/python3.9/site-packages/thriftpy2/parser/__init__.py:171: in load_fp
    thrift = parse_fp(source, module_name)
/opt/conda/envs/test/lib/python3.9/site-packages/thriftpy2/parser/parser.py:628: in parse_fp
    if enable_cache and module_name in threadlocal.thrift_cache:
E   AttributeError: '_thread._local' object has no attribute 'thrift_cache'

Perhaps the change to parse() done in this PR should also be applied to parse_fp()?

@aisk
Copy link
Member

aisk commented Jun 26, 2024

Yes, it's my fault, I thought parse is using parse_fp under the hood, but it's not.

kuanghy added a commit to JoinQuant/jqdatasdk that referenced this issue Jun 27, 2024
thriftpy2==0.5.1 有 bug,会导致无法使用,见:Thriftpy/thriftpy2#281
@aisk aisk closed this as completed in #284 Jun 28, 2024
@aisk
Copy link
Member

aisk commented Jun 28, 2024

Released a beta version v0.5.2b1 which contains the fix.

@tyong920
Copy link

tyong920 commented Jul 4, 2024

Bitten by the same bug, Pls yank version v0.5.0 and v0.5.1.

Appreciated!

@aisk
Copy link
Member

aisk commented Jul 4, 2024

I released v0.5.2b2 which also contains a bugfix that some user needs in a hurry. I will release v0.5.2 tomorrow if no one report bug about it. I notified some users to test the v0.5.2b2.

Yank v0.5.0 and v0.5.1 is not a good choice because I see some user are already using it and pined the version to 0.5.

@aisk
Copy link
Member

aisk commented Jul 5, 2024

v0.5.2 just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants