[sqlalchemy] mysql and python datetime

2013-04-04 Thread algotr8der
|delete<http://stackoverflow.com/questions/15821953/mysql-and-python-datetime#> |flag<http://stackoverflow.com/questions/15821953/mysql-and-python-datetime#> edited just now <http://stackoverflow.com/posts/15821953/revisions> asked 15 mins ago <http://stackoverflow.co

Re: [sqlalchemy] python: sqlalchemy - how do I ensure connection not stale using new event system

2013-04-03 Thread algotr8der
I think you nailed it. This is the problem. I will follow the approach you indicated. Thank you Michael. I appreciate it. On Tuesday, April 2, 2013 1:35:07 PM UTC-7, Michael Bayer wrote: > if you're doing a query that is causing the database connection to simply > fail, then you'd need to addr

[sqlalchemy] Re: python: sqlalchemy - how do I ensure connection not stale using new event system

2013-04-02 Thread algotr8der
To clarify my environment. I have a VM (Linux Redhat) which has MySQL server running on it. My script runs locally on the same machine. It is a simple script that is doing a insert many after processing/parsing a csv file. I don't have any web apps or anything of that nature. On Monday, April

[sqlalchemy] Re: python: sqlalchemy - how do I ensure connection not stale using new event system

2013-04-02 Thread algotr8der
I tried to include pool_recycle = 10 (seconds) in my create_engine call but that doesn't fix the problem. I still get the same error. Hmm On Monday, April 1, 2013 7:04:48 PM UTC-7, algot...@gmail.com wrote: > > I am using the sqlalchemy package in python. I have an operation that > takes som

[sqlalchemy] Re: python: sqlalchemy - how do I ensure connection not stale using new event system

2013-04-02 Thread algotr8der
Below is the traceback. When it attempts to perform the conn.execute(), which is the db insert is where it seems to realize the connection is stale. Traceback (most recent call last): File "myscript.py", line 126, in main() File "myscript.py", line 33, in main insert_data(final_dat

Re: [sqlalchemy] python: sqlalchemy - how do I ensure connection not stale using new event system

2013-04-01 Thread algotr8der
Thank you Michael for your response. So its not a long query that I think is the problem here because I don't believe the execution gets that far. My suspicion is that it is the line that computes the dictionary key/value pairs, which takes a long time since it has to build 677,161 x 10 (colu

[sqlalchemy] python: sqlalchemy - how do I ensure connection not stale using new event system

2013-04-01 Thread algotr8der
I am using the sqlalchemy package in python. I have an operation that takes some time to execute after I perform an autoload on an existing table. This causes the following error when I attempt to use the connection: sqlalchemy.exc.OperationalError: (OperationalError) (2006, 'MySQL server has

[sqlalchemy] python: sqlalchemy + xlrd + csv = '' empty string in blank/empty cells causing insert error

2013-03-27 Thread algotr8der
I have a file that I download from the internet. It is in .xls format. I need to save the data to an sql database. So I extract the data as follows: import xlrd wb = xlrd.open_workbook(file_contents=xls_file_name.read()) sh = wb.sheet_by_name('Sheet1') data = [sh.row_values(r) for r in range(sh