diff options
author | Marko Kreen | 2013-09-18 13:02:46 +0000 |
---|---|---|
committer | Marko Kreen | 2013-09-18 13:02:46 +0000 |
commit | dde487beaef91e9bb0ae2c5f24a457586f1b7c14 (patch) | |
tree | f8e0b142c63df3cfc19f4c2677c0813c8e201f55 | |
parent | 38b0f2d5bdc6b1a1ec64ebd0b43650042d910bf3 (diff) |
Get rid of dictfetch*() usage, it's obsolete.
-rwxr-xr-x | old/simple_serial_consumer.py | 2 | ||||
-rw-r--r-- | python/londiste/playback.py | 6 | ||||
-rw-r--r-- | python/pgq/baseconsumer.py | 4 | ||||
-rw-r--r-- | python/pgq/status.py | 4 | ||||
-rw-r--r-- | python/skytools/dbstruct.py | 2 | ||||
-rw-r--r-- | scripts/data_maintainer.py | 6 |
6 files changed, 12 insertions, 12 deletions
diff --git a/old/simple_serial_consumer.py b/old/simple_serial_consumer.py index 2bd06be7..76e1cd47 100755 --- a/old/simple_serial_consumer.py +++ b/old/simple_serial_consumer.py @@ -83,7 +83,7 @@ class SimpleSerialConsumer(pgq.SerialConsumer): self.log.debug(self.dst_query % payload) curs.execute(self.dst_query, payload) try: - res = curs.dictfetchone() + res = curs.fetchone() self.log.debug(res) except: pass diff --git a/python/londiste/playback.py b/python/londiste/playback.py index 8d0b2a94..bc20920c 100644 --- a/python/londiste/playback.py +++ b/python/londiste/playback.py @@ -789,7 +789,7 @@ class Replicator(CascadedWorker): new_list = [] new_map = {} - for row in curs.dictfetchall(): + for row in curs.fetchall(): if not row['local']: continue t = self.get_table_by_name(row['table_name']) @@ -929,7 +929,7 @@ class Replicator(CascadedWorker): # restore fkeys -- one at a time q = "select * from londiste.get_valid_pending_fkeys(%s)" dst_curs.execute(q, [self.set_name]) - fkey_list = dst_curs.dictfetchall() + fkey_list = dst_curs.fetchall() for row in fkey_list: self.log.info('Creating fkey: %(fkey_name)s (%(from_table)s --> %(to_table)s)' % row) q2 = "select londiste.restore_table_fkey(%(from_table)s, %(fkey_name)s)" @@ -945,7 +945,7 @@ class Replicator(CascadedWorker): dst_curs = dst_db.cursor() q = "select * from londiste.find_table_fkeys(%s)" dst_curs.execute(q, [table_name]) - fkey_list = dst_curs.dictfetchall() + fkey_list = dst_curs.fetchall() for row in fkey_list: self.log.info('Dropping fkey: %s' % row['fkey_name']) q2 = "select londiste.drop_table_fkey(%(from_table)s, %(fkey_name)s)" diff --git a/python/pgq/baseconsumer.py b/python/pgq/baseconsumer.py index 3ea1c6c6..fbb28c80 100644 --- a/python/pgq/baseconsumer.py +++ b/python/pgq/baseconsumer.py @@ -48,7 +48,7 @@ class BaseBatchWalker(object): q = "fetch %d from %s" % (self.fetch_size, self.sql_cursor) while 1: - rows = self.curs.dictfetchall() + rows = self.curs.fetchall() if not len(rows): break @@ -296,7 +296,7 @@ class BaseConsumer(skytools.DBScript): if self.consumer_filter is not None: sql += " where %s" % self.consumer_filter curs.execute(sql) - rows = curs.dictfetchall() + rows = curs.fetchall() # map them to python objects ev_list = [] diff --git a/python/pgq/status.py b/python/pgq/status.py index eb6bc6be..ccaf0aa8 100644 --- a/python/pgq/status.py +++ b/python/pgq/status.py @@ -44,7 +44,7 @@ class PGQStatus(skytools.DBScript): ival('q.queue_ticker_idle_period'), ) cx.execute(q) - event_rows = cx.dictfetchall() + event_rows = cx.fetchall() q = """select queue_name, consumer_name, %s, %s, pending_events from pgq.get_consumer_info()""" % ( @@ -52,7 +52,7 @@ class PGQStatus(skytools.DBScript): ival('last_seen'), ) cx.execute(q) - consumer_rows = cx.dictfetchall() + consumer_rows = cx.fetchall() print("\n%-33s %9s %13s %6s %6s %5s" % ('Event queue', 'Rotation', 'Ticker', 'TLag', 'EPS', 'New')) diff --git a/python/skytools/dbstruct.py b/python/skytools/dbstruct.py index e1a7012c..cf7b291f 100644 --- a/python/skytools/dbstruct.py +++ b/python/skytools/dbstruct.py @@ -552,7 +552,7 @@ class BaseStruct(object): #print "Loading %s, name=%s, args=%s" % (repr(eclass), repr(name), repr(args)) sql = eclass.get_load_sql(curs.connection.server_version) curs.execute(sql % args) - for row in curs.dictfetchall(): + for row in curs.fetchall(): elem_list.append(eclass(name, row)) return elem_list diff --git a/scripts/data_maintainer.py b/scripts/data_maintainer.py index 5bd8cd87..ecb0c377 100644 --- a/scripts/data_maintainer.py +++ b/scripts/data_maintainer.py @@ -126,7 +126,7 @@ class DataMaintainer (skytools.DBScript): bcur = bdb.cursor() bcur.execute(self.sql_before) if bcur.statusmessage.startswith('SELECT'): - res = bcur.dictfetchall() + res = bcur.fetchall() assert len(res)==1, "Result of a 'before' query must be 1 row" bres = res[0].copy() @@ -153,7 +153,7 @@ class DataMaintainer (skytools.DBScript): rcur.execute("FETCH FORWARD %s FROM data_maint_cur" % self.fetchcnt) self.log.debug(rcur.query) self.log.debug(rcur.statusmessage) - res = rcur.dictfetchall() + res = rcur.fetchall() count, lastitem = self.process_batch(res, mcur, bres) total_count += count if not self.autocommit: @@ -202,7 +202,7 @@ class DataMaintainer (skytools.DBScript): mcur.execute(self.sql_modify, item) self.log.debug(mcur.query) if mcur.statusmessage.startswith('SELECT'): # if select was used we can expect some result - mres = mcur.dictfetchall() + mres = mcur.fetchall() for r in mres: if 'stats' in r: # if specially handled column 'stats' is present for k, v in skytools.db_urldecode(r['stats']).items(): |