From 3ed6dbe5ae4399756ed6ff817d0ae56fd0b2944e Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Thu, 14 Mar 2024 19:41:13 -0300 Subject: [PATCH] fix: fix python syntax on issue_219.py --- examples/notes/issue_219.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/examples/notes/issue_219.py b/examples/notes/issue_219.py index 48b94f4a..4b612160 100644 --- a/examples/notes/issue_219.py +++ b/examples/notes/issue_219.py @@ -11,21 +11,20 @@ # -import sys -sys.path.insert(0, '../src') -import petl; print petl.VERSION -from petl.fluent import etl -import psycopg2 import MySQLdb +import psycopg2 -# +import petl +from petl.fluent import etl +# +print(petl.VERSION) tbl_dummy_data = etl().dummytable(100000) tbl_dummy_data.look() # -print tbl_dummy_data.nrows() +print(tbl_dummy_data.nrows()) # @@ -48,12 +47,12 @@ # # memory usage using default cursor -print etl.fromdb(psql_connection, 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(psql_connection, 'select * from issue_219 order by foo').look(2)) # # memory usage using server-side cursor -print etl.fromdb(lambda: psql_connection.cursor(name='server-side'), 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(lambda: psql_connection.cursor(name='server-side'), 'select * from issue_219 order by foo').look(2)) # @@ -77,10 +76,10 @@ # # memory usage with default cursor -print etl.fromdb(mysql_connection, 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(mysql_connection, 'select * from issue_219 order by foo').look(2)) # # memory usage with server-side cursor -print etl.fromdb(lambda: mysql_connection.cursor(MySQLdb.cursors.SSCursor), 'select * from issue_219 order by foo').look(2) +print(etl.fromdb(lambda: mysql_connection.cursor(MySQLdb.cursors.SSCursor), 'select * from issue_219 order by foo').look(2))