Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Possible bug in update universe function
API

The universe is probably getting updated with junk values. Or is it a problem with my code?

It does not have the securities which I fetched, although I updated the universe.

Check the log output.

I essentially do this in the before trading start function

data = eligibleSecurities or data  

but when I do this in the handle data function

len(eligibleSecurities) = len(data and eligibleSecurities)  

some values get truncated and there are some garbage values in data

Using set theory

len(eligibleSecurities) <=> len(data and eligibleSecurities)  
=>len(eligibleSecurities) <=> len(( eligibleSecurities or data)and eligibleSecurities)
=>len(eligibleSecurities) <=> len(eligibleSecurities or (data and eligibleSecurities))
=>len(eligibleSecurities) <=> len(eligibleSecurities)

Which is always true.