Python generator - Timeouts and arbitrary failures
moody31415
Posts: 8
I don't understand why I'm getting timeouts and seemingly arbitrary failures when using the generator and generating data.
I'll open a project and it'll just say "python script timed out" - and it's timing out in an unnoticeable amount of time, eg, under 1/10 of a second.
And then I'll go and click on the column, it'll show me the generation script, and then it'll generate the data preview immediately.
Then I'll tell it to actually generate data, and I'll get an error about "the value '' cannot be inserted into column foo", which doesn't make sense to me - all the columns in this table are nullable. What is the value it's complaining about? And since the report is a pdf I can't just copy and paste the message here...
And then when that happens, half the time I'll go back and look at my code and it will be completely blank and I'll have to start over again.
Can someone help me figure out why I'm getting these errors? I'd really like to use the data generator to populate our test database with realistic data - but trying to do anything beyond the default configuration is giving me lots of errors
I'll open a project and it'll just say "python script timed out" - and it's timing out in an unnoticeable amount of time, eg, under 1/10 of a second.
And then I'll go and click on the column, it'll show me the generation script, and then it'll generate the data preview immediately.
Then I'll tell it to actually generate data, and I'll get an error about "the value '' cannot be inserted into column foo", which doesn't make sense to me - all the columns in this table are nullable. What is the value it's complaining about? And since the report is a pdf I can't just copy and paste the message here...
And then when that happens, half the time I'll go back and look at my code and it will be completely blank and I'll have to start over again.
Can someone help me figure out why I'm getting these errors? I'd really like to use the data generator to populate our test database with realistic data - but trying to do anything beyond the default configuration is giving me lots of errors
Comments
import sre_parse
re.sre_parse = sre_parse
import exrex
def main(config):
retValue="abc@def.com"
try:
retValue = exrex.getone('[a-z]{4,8}([0-9]{0,3}|\.[a-z]{4,10})@([a-z]{4,9}\.)?([a-z]{6})\.(org|com|net)')
return retValue
except:
return retValue