Python generator - Timeouts and arbitrary failures

moody31415moody31415 Posts: 8
edited October 20, 2015 5:49PM in SQL Data Generator
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 :(

Comments

  • sstubbssstubbs Posts: 1 New member
    I just started using version 3.0.1.560 and experience the same problems you are having with python scripts. Other than workarounds, did you hear from Redgate about a fix?
  • AvellaAvella Posts: 5 New member
    I'm troubled seeing this issue from 4 years ago unanswered.  I experience random Python failures with no details other than what the original posted stated.  I'm hoping Redgate pays attention to this.
  • AvellaAvella Posts: 5 New member
    For further context, I have a python script that generates an email based on a regex.  It is wrapped in a try/exception block and returns a default value upon error.  The column it populates is nullable.  When I run the generator, it will fail anywhere from 100k-500k rows generated with the generic "the value '' cannot be inserted".  The log files from the tool are always empty with 0kb.

    Script:

    import re
    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


Sign In or Register to comment.