Hi Dirk,
Happy to report that there are more projects using dw. I have the same
issues here. Using Azure SQL DW at the moment and building a serverless
function app that reads and sends data back to the SQL DW.
Did you eventually find a solution other than looping through the dataframe?
Cheers,
Nicole
On Wednesday, September 13, 2017 at 5:39:47 PM UTC-5, dirk.biesinger wrote:
>
> 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 UTC-7, Mike Bayer wrote:
>>
>> 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 willing
>> to give them a credit card number so I can perhaps eventually get
>> around to working with that but at the moment it would be preferable
>> if someone wants to work on an azure variant of the SQL Server
>> dialect.It shouldn't be hard but the various glitches need to be
>> understood for anything to be committed.
>>
>> >
>> > 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
>> >> 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 interesting.
>> >>
>> >>
>> >> >
>> >> >
>> >> > On Wednesday, September 13, 2017 at 1:16:59 PM UTC-7, Mike Bayer
>> wrote:
>> >> >>
>> >> >> 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)
>> >> >> > cursor.close()
>> >> >> >
>> >> >> > gives me the output out of the table that I expect.
>> >> >> > So if you were wondering if a raw pyodbc connection works, this
>> is
>> >> >> > confirmed.
>> >> >>
>> >> >> did you call:
>> >> >>
>> >> >> connection.rollback()
>> >> >>
>> >> >> the stack traces you have given me indicate this method cannot be
>> >> >> called else Azure raises an error. This must be illustrated as
>> >> >> definitely the problem, and not a side effect of something else.
>> >> >>
>> >> >> This is why this would go a lot quicker if someone had a *blank*
>> azure
>> >> >> database on a cloud node somewhere for me to log into. I don't
>> need
>> >> >> your customer data.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> >
>> >> >> > On Wednesday, September 13, 2017 at 12:49:33 PM UTC-7, Mike Bayer
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> 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:
>> >> >> >> >>
>> >> >> >> >> 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?
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> connection = pyodbc.connect()
>> >> >> >> >> connection.autocommit = 0
>> >> >> >> >> connection.rollback()
>> >> >> >>
>> >> >> >>
>> >> >> >> try it like this:
>> >> >> >>
>> >> >> >>
>> >> >> >> connection = pyodbc.connect()
>> >> >> >> connection.autocommit = 0
>> >> >> >> cursor = connection.cursor()
>> >> >> >> cursor.execute("SELECT 1")
>> >> >> >> cursor.close()
>> >> >> >>
>> >> >> >> connection.rollback()
>> >> >> >>
>> >> >> >>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> > 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