Closed asmithh closed 3 years ago
Hmm I'm having a hard time figuring out why this might be happening.
On line 277 during the initialization of the object, self.n_zeros
is initialized if we're getting counts.
Since the code has to have self.get_counts=True
on line 547 to get to line 555, I'm not seeing how self.n_zeros
couldn't be set for the object.
Just to check, your command for running this looked something like python -m twitter.search ivermectin --get_counts
?
I think what is going on is that we can't get to that line yet because we're calling self.update_query()
at line 273, before we even get to that conditional. I think that in turn needs self.n_zeros to have a value, which hasn't been assigned yet if this is the first command you run. So maybe it's a weird edge case?
I did run python -m twitter.search ivermectin --get_counts
and maybe it's worth noting that that was the first command I tried. That could have something to do with it. Sorry this is behaving so weirdly for me!!
🤦 You're right, that's what I get for trying to look at code first thing in the morning.
Thanks for catching this, it should be fixed now if you pull the latest commit (c1f3807b9c9fdb786bdffe1483fda0ed5880801a). Let me know if run into any other trouble!
https://github.com/ryanjgallagher/focalevents/blob/22afb52a4c6b7a3d38a73d4cf70b993db4311546/twitter/search.py#L555
Here's my error message:
I think that when we call
self.update_query()
in some cases we're referencing the parametern_zeros
before it's assigned to the SearchListener? Not sure if that's intentional behavior; happy to help fix if it isn't.