Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
There is definitely interest in this platform and we will need to support it. It's just it falls under the category of a subscriber database like Redhift or google whatever it was called so needs some folks with access to get it working and possibly support an external overlay project -

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
yeah, I ran into some 'nice' 'features' in this project. the azure datawarehouse does not behave or work like a typical old-school sql server. There might be some potential there, just not sure how many projects would be using the datawarehouse On Wednesday, September 13, 2017 at 3:33:20 PM

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 6:13 PM, dirk.biesinger wrote: > "oh that is very interesting." he says and then it's getting eerily quiet. > I guess Mike and Dilly are somewhere in the depth of code and docs... unfortunately not, azure seems to offer free trials if you are

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
"oh that is very interesting." he says and then it's getting eerily quiet. I guess Mike and Dilly are somewhere in the depth of code and docs... On Wednesday, September 13, 2017 at 2:05:22 PM UTC-7, Mike Bayer wrote: > > On Wed, Sep 13, 2017 at 4:29 PM, dirk.biesinger >

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 4:29 PM, dirk.biesinger wrote: > > as for the rollback call, > adding it after the print command, does not change anything. > When I insert it between cursor.execute() and rows = cursor.fetchall(), I > get an error as expected. oh that is very

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
I hear your pain, unfortunately we have to have very tight security on our server instances; I only can log into the server when I am in the office, I can't log in with my work laptop from home. (I have a not authorized ip address there) If it were a possible, I would have given you access to a

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 3:58 PM, dirk.biesinger wrote: > using > > connection = pyodbc.connect() > connection.autocommit = 0 > cursor = connection.cursor() > cursor.execute([proper sql statement that references a table]) > rows = corsor.fetchall() > print(rows) >

Re: [sqlalchemy] use_ansi inconsistency with relationship's primaryjoin

2017-09-13 Thread Kent
Never mind that last silly 0.7 question. (Your patch is compatible it seems.) (And pretend that you didn't hear any mention of 0.7) Thanks again for your awesome software! Kent On Wednesday, September 13, 2017 at 3:42:55 PM UTC-4, Kent wrote: > > >> dude!it is 2017. get on this client!

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
using connection = pyodbc.connect() connection.autocommit = 0 cursor = connection.cursor() cursor.execute([proper sql statement that references a table]) rows = corsor.fetchall() print(rows) cursor.close() gives me the output out of the table that I expect. So if you were wondering if a raw

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 3:27 PM, dirk.biesinger wrote: > I have the 'patched' pyodbc.py file active. > Executing your code snippet does NOT produce an error or any output for that > matter. > > > On Wednesday, September 13, 2017 at 12:22:30 PM UTC-7, Mike Bayer wrote: >>

Re: [sqlalchemy] use_ansi inconsistency with relationship's primaryjoin

2017-09-13 Thread Kent
> > > dude!it is 2017. get on this client! :) I literally have to > maintain this feature for you personally :). > > > Hahaha! If you could only feel my pain! Unfortunately, there are multiple clients still on 8i because they are stuck on it due to their legacy application (which

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
I have the 'patched' pyodbc.py file active. Executing your code snippet does NOT produce an error or any output for that matter. On Wednesday, September 13, 2017 at 12:22:30 PM UTC-7, Mike Bayer wrote: > > On Wed, Sep 13, 2017 at 3:14 PM, dirk.biesinger > wrote: > >

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 3:14 PM, dirk.biesinger wrote: > Got ya, > > so we could solve the issue on the sqlalchemy end with the alteration of the > pyodbc.py file. > I assume you'll include this in the next release? um. can you just confirm for me this makes the error?

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
Got ya, so we could solve the issue on the sqlalchemy end with the alteration of the pyodbc.py file. I assume you'll include this in the next release? The issue with creating a table when the option "if_exists='append'" is set in the df.to_sql() call, is a pandas problem. Thank you for your

Re: [sqlalchemy] use_ansi inconsistency with relationship's primaryjoin

2017-09-13 Thread Mike Bayer
https://bitbucket.org/zzzeek/sqlalchemy/issues/4076/oracle-8-non-ansi-joins-needs-to-apply-to On Wed, Sep 13, 2017 at 2:41 PM, Mike Bayer wrote: > this is also a bug. the operator here shouldn't matter for the "(+)" > operator to be added, that's easy to fix. (doing

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 2:41 PM, dirk.biesinger wrote: > I don't get why the table is getting created in the first place. A table > with this name exists, and the option "if_exists='append'" should append the > dataframe to the existing table. > There should not be a

Re: [sqlalchemy] use_ansi inconsistency with relationship's primaryjoin

2017-09-13 Thread Mike Bayer
this is also a bug. the operator here shouldn't matter for the "(+)" operator to be added, that's easy to fix. (doing it for 1.2 for now). On Wed, Sep 13, 2017 at 2:26 PM, Mike Bayer wrote: > On Wed, Sep 13, 2017 at 12:01 PM, Kent wrote: >>

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
I don't get why the table is getting created in the first place. A table with this name exists, and the option "if_exists='append'" should append the dataframe to the existing table. There should not be a dropping of the table (which I have not seen) nor creation of the table. And in case of

Re: [sqlalchemy] use_ansi inconsistency with relationship's primaryjoin

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 12:01 PM, Kent wrote: > I've got a strange relationship on a legacy Oracle 8i database which I need > to support (whether I like it or not). dude!it is 2017. get on this client! :) I literally have to maintain this feature for you

Re: [sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
OK sodon't use VARCHAR(max)? What datatype would you like? We have most of them and you can make new ones too. On Wed, Sep 13, 2017 at 1:07 PM, dirk.biesinger wrote: > Mike, > > here's the error stack (I had to mask some details): > The columns (dataformats) in

[sqlalchemy] Re: pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread dirk.biesinger
Mike, here's the error stack (I had to mask some details): The columns (dataformats) in the create table statement are wrong. Also, this table does not have an index. 2017-09-13 15:07:50,200 INFO sqlalchemy.engine.base.Engine SELECT SERVERPROPERTY('ProductVersion') 2017-09-13 15:07:50,202

[sqlalchemy] use_ansi inconsistency with relationship's primaryjoin

2017-09-13 Thread Kent
I've got a strange relationship on a legacy Oracle 8i database which I need to support (whether I like it or not). The cleanest approach is specifying that the 'primaryjoin' to the relationship in the mapper should include an extra join clause. I hate doing this, but after many other

Re: [sqlalchemy] pandas to MS SQL DataWarehouse (to_sql)

2017-09-13 Thread Mike Bayer
We will need to add a new flag to the SQLAlchemy dialect that disallows any transaction calls of any kind including rollbacks on an autocommit connection since pyodbc is being buggy here. On Wed, Sep 13, 2017 at 11:34 AM, Dirk Biesinger wrote: > Actually Mike, > > the

Re: [sqlalchemy] Non-server-side defaults for insert query with multiple values

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 7:42 AM, Colin Deasy wrote: > Hi Mike, > > Thanks for the detailed response. > The workaround looks fine but I'm cautious of relying on the internal > behaviour; in particular the naming convention "_m" and modifying the > current params

Re: [sqlalchemy] Creat table with IF NOT EXISTS caulse in MySQL

2017-09-13 Thread Mike Bayer
On Wed, Sep 13, 2017 at 1:18 AM, sqlalchemy_mysql wrote: > Noticed that generated 'create table' is missing 'IF NOT EXISTS' clause so > when the code is run in parallel. It throws OperationalError 1050 Table > already exists. We call metadata.create_all method, checkfirst is

Re: [sqlalchemy] Non-server-side defaults for insert query with multiple values

2017-09-13 Thread Colin Deasy
Hi Mike, Thanks for the detailed response. The workaround looks fine but I'm cautious of relying on the internal behaviour; in particular the naming convention "_m" and modifying the current params dictionary rather than returning a value. A concern I have with executemany is that we render the