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

Initialize thread local value on each thread #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonson
Copy link

@jonson jonson commented May 2, 2020

Attributes on the thread local metadata variable were being initialized at import time by the calling thread. All access from other threads were result in errors like AttributeError: '_thread._local' object has no attribute 'minperiods''.

This change make the initialization lazy via a property and binds to the calling thread.

Copy link

@drhighliner drhighliner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the code. Works like a charm!

@Haakam21
Copy link

Haakam21 commented Apr 1, 2021

I am getting the following error when calling indicators from a thread:

Unhandled Error Traceback (most recent call last): ... File "/Users/haakamaujla/Library/Python/3.8/lib/python/site-packages/pandas/core/indexers.py", line 171, in check_setitem_lengths raise ValueError( builtins.ValueError: cannot set using a slice indexer with a different length than the value

@luke82
Copy link

luke82 commented Apr 13, 2021

I test it just now and for me worked like charm too! THX

Copy link

@dangbh1002 dangbh1002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, this will be handy

neilsmurphy added a commit to neilsmurphy/bta-lib that referenced this pull request Aug 24, 2021
neilsmurphy added a commit to neilsmurphy/bta-lib that referenced this pull request Aug 24, 2021
Changed as per Initialize thread local value on each thread mementum#4 in bta…
Copy link

@spyke555 spyke555 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the issue I was having, thanks!

@luizgomesdev
Copy link

Thanks man! U are awesome.

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 this pull request may close these issues.

7 participants