Skip to content

Commit

Permalink
Fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
sgandhi1311 committed Dec 9, 2024
1 parent 288d057 commit 144f0b1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tap_mongodb/sync_strategies/oplog.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def maybe_get_session(client):
# return an object that works with a 'with' block
return SessionNotAvailable()

# pylint: disable=too-many-arguments, too-many-positional-arguments
def process_row(schema, row, stream, update_buffer, rows_saved, version, time_extracted):
row_op = row['op']

Expand Down Expand Up @@ -156,7 +157,7 @@ def process_row(schema, row, stream, update_buffer, rows_saved, version, time_ex
singer.write_message(record_message)

rows_saved += 1

return (rows_saved, update_buffer)

# pylint: disable=too-many-locals, too-many-branches, too-many-statements
Expand Down Expand Up @@ -238,17 +239,17 @@ def sync_collection(client, stream, state, stream_projection, max_oplog_ts=None)
stream_state['oplog_ts_inc']):
raise common.MongoAssertionException(
"Mongo is not honoring the sort ascending param")

row_namespace = row['ns']
if row_namespace == 'admin.$cmd':
# If the namespace is 'admin.$cmd', then the operation on the record was performed as part
# If the namespace is 'admin.$cmd', then the operation on the record was performed as part
# of a transaction and is recorded as a transactional applyOps entry.
for transaction_row in row['o']['applyOps']:
transaction_row['ts'] = row['ts']
rows_saved, update_buffer = process_row(schema, transaction_row, stream, update_buffer,
rows_saved, update_buffer = process_row(schema, transaction_row, stream, update_buffer,
rows_saved, version, time_extracted)
else:
rows_saved, update_buffer = process_row(schema, row, stream, update_buffer,
rows_saved, update_buffer = process_row(schema, row, stream, update_buffer,
rows_saved, version, time_extracted)


Expand Down

0 comments on commit 144f0b1

Please sign in to comment.