Teradata SQL Driver for Python - Rows are closed error

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
New Member

Teradata SQL Driver for Python - Rows are closed error

I have a query that returns 3 records, and when running the below code (this is just a repro example, not the actual code) I get the follow exception on the last line (when calling fetchmany for the 2nd time):
"teradatasql.OperationalError: sql: Rows are closed"
 
Based on the documentation in pypi (https://pypi.org/project/teradatasql/) fetchmany should return an empty result set if all rows have been consumed, but in my case it seems to be closing the connection...?
 
I am seeing the same behavior on Windows 10 and Linux, both with Python 3.6.3.
 
 
def discoverTest(hostname, username, password):
con = teradatasql.connect(None, host=hostname, user=username, password=password, log="1",encryptdata="true")
cur = con.cursor()
statement = statements.getDiscoveryStatement()
cur.execute(statement)
records = cur.fetchmany(10)
records = cur.fetchmany(10)

 

2 REPLIES
Teradata Employee

Re: Teradata SQL Driver for Python - Rows are closed error

Thanks for the report! We will investigate.

Teradata Employee

Re: Teradata SQL Driver for Python - Rows are closed error

This problem corresponds to issue PYDBAPI-57 and was fixed in teradatasql 16.20.0.41