Re: [sqlalchemy] Deleting rows from a table where row elements are found in a pandas.DataFrame

2018-01-04 Thread Jevgenij Kusakovskij
I sorted this problem out and, as you predicted, it turned out to be layers upon layers of problems. If you do not mind having a quick look at how I resolved this, I would really appreciate some feedback and a second opinion... I actually missed the main problem initially. It had to do with the

Re: [sqlalchemy] Deleting rows from a table where row elements are found in a pandas.DataFrame

2018-01-03 Thread Jevgenij Kusakovskij
It is a list of dictionaries indeed. I will investigate this issue tomorrow. If something useful comes out or if I have any more questions, I will write back here. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please prov

Re: [sqlalchemy] Deleting rows from a table where row elements are found in a pandas.DataFrame

2018-01-03 Thread Jevgenij Kusakovskij
Thank you for such a quick response! Tried your suggestions, but still getting the same error. And could it be caused by some data in the DataFrame being 'odd'? E.g. Timestamp('2012-05-22 00:00:00') assigned to col2. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://

[sqlalchemy] Deleting rows from a table where row elements are found in a pandas.DataFrame

2018-01-03 Thread Jevgenij Kusakovskij
I feel bad bugging you with questions everyday, but it seems that I get them answered here... Hope I am not abusing your hospitality. I would like to delete multiple rows from a table on a MS SQL Server. The rows to be deleted are given in a `pandas.DataFrame` object and there can be thousands

Re: [sqlalchemy] Speeding up inserts of lines with fast_executemany option of pyODBC

2018-01-02 Thread Jevgenij Kusakovskij
Great! Thanks a lot for all your help! On Tuesday, January 2, 2018 at 6:48:35 PM UTC+2, Mike Bayer wrote: > > On Tue, Jan 2, 2018 at 11:24 AM, Jevgenij Kusakovskij > wrote: > > I see... I should have warned that I am new to Python and that questions > of > > this c

Re: [sqlalchemy] Speeding up inserts of lines with fast_executemany option of pyODBC

2018-01-02 Thread Jevgenij Kusakovskij
ns and the code runs almost as fast as the raw connection, i.e. in 2 seconds instead of 2.5 minutes. Thank you kindly for the clarifications, for the quick responses and for your patience! On Tuesday, January 2, 2018 at 5:15:52 PM UTC+2, Mike Bayer wrote: > > On Tue, Jan 2, 2018 at 9

Re: [sqlalchemy] Speeding up inserts of lines with fast_executemany option of pyODBC

2018-01-02 Thread Jevgenij Kusakovskij
ecutemany = True Maybe I am missing something, but should it be: if context.execution_options.get('pyodbc_fast_execute', True): cursor.fast_executemany = True On Tuesday, January 2, 2018 at 4:27:53 PM UTC+2, Mike Bayer wrote: > > On Tue, Jan 2, 2018 at 6:46 AM, Je

[sqlalchemy] Speeding up inserts of lines with fast_executemany option of pyODBC

2018-01-02 Thread Jevgenij Kusakovskij
I would like to send a large pandas.DataFrame to a remote server running MS SQL. I am using pandas-0.20.3, pyODBC-4.0.21 and sqlalchemy-1.1.13. My first attempt of tackling this problem can be reduced to following code: import sqlalchemy as sa engine = sa.create_engine("mssql+pyodbc:///?od

[sqlalchemy] Re: Error when upgrading to 0.7.5 from 0.7.3 in "subqueryload()"

2012-02-14 Thread Jevgenij
 pm, Michael Bayer wrote: > On Feb 13, 2012, at 10:18 AM, Jevgenij wrote: > > > > > > > > > > > Hi SQLAlchemy users, > > > We are using SQLAlchemy for our new web app, and ran into a problem, > > still learning and are unsure if we found a bug or

[sqlalchemy] Error when upgrading to 0.7.5 from 0.7.3 in "subqueryload()"

2012-02-13 Thread Jevgenij
Hi SQLAlchemy users, We are using SQLAlchemy for our new web app, and ran into a problem, still learning and are unsure if we found a bug or we are just using the framework wrong. We have a table called "user" and two child tables: -- class FacebookConnect(Base): __tablename__ = 'facebook