Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
AP-1477: Bump python-mysql-replication (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samira-El authored May 19, 2023
1 parent 5f3c634 commit 0db0b1b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ GRANT ALL PRIVILEGES ON tap_mysql_test.* TO <mysql-user>;
export TAP_MYSQL_PORT=<mysql-port>
export TAP_MYSQL_USER=<mysql-user>
export TAP_MYSQL_PASSWORD=<mysql-password>
export TAP_MYSQL_ENGINE=<engine>
```

3. Install python test dependencies in a virtual env
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'pendulum==2.1.2',
'pipelinewise-singer-python==1.*',
'PyMySQL==1.0.2',
'mysql-replication==0.30',
'mysql-replication==0.40',
'plpygis==0.2.0',
'tzlocal==2.1',
],
Expand Down
18 changes: 0 additions & 18 deletions tap_mysql/binlogstream.py

This file was deleted.

8 changes: 4 additions & 4 deletions tap_mysql/sync_strategies/binlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from typing import Dict, Set, Union, Optional, Any, Tuple
from plpygis import Geometry
from pymysqlreplication import BinLogStreamReader
from pymysqlreplication.constants import FIELD_TYPE
from pymysqlreplication.event import RotateEvent, MariadbGtidEvent, GtidEvent
from pymysqlreplication.row_event import (
Expand All @@ -24,7 +25,6 @@
from singer import utils, Schema, metadata

from tap_mysql import connection
from tap_mysql.binlogstream import CustomBinlogStreamReader
from tap_mysql.connection import connect_with_backoff, make_connection_wrapper, MySQLConnection
from tap_mysql.discover_utils import discover_catalog, desired_columns, should_run_discovery
from tap_mysql.stream_utils import write_schema_message
Expand Down Expand Up @@ -591,7 +591,7 @@ def __get_diff_in_columns_list(
# pylint: disable=R1702,R0915
def _run_binlog_sync(
mysql_conn: MySQLConnection,
reader: CustomBinlogStreamReader,
reader: BinLogStreamReader,
binlog_streams_map: Dict,
state: Dict,
config: Dict,
Expand Down Expand Up @@ -793,7 +793,7 @@ def create_binlog_stream_reader(
log_file: Optional[str],
log_pos: Optional[int],
gtid_pos: Optional[str]
) -> CustomBinlogStreamReader:
) -> BinLogStreamReader:
"""
Create an instance of BinlogStreamReader with the right config
Expand Down Expand Up @@ -851,7 +851,7 @@ def create_binlog_stream_reader(
kwargs['log_pos'] = log_pos
kwargs['resume_stream'] = True

return CustomBinlogStreamReader(**kwargs)
return BinLogStreamReader(**kwargs)


def sync_binlog_stream(
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/sync_strategies/test_binlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def test_sync_binlog_stream_with_log_file_and_pos(self,
with patch('tap_mysql.sync_strategies.binlog.singer.write_message') as write_msg:
write_msg.side_effect = lambda msg: singer_messages.append(msg)

with patch('tap_mysql.sync_strategies.binlog.CustomBinlogStreamReader',
with patch('tap_mysql.sync_strategies.binlog.BinLogStreamReader',
autospec=True) as reader_mock:
def iter_mock(_):
log_files = [
Expand Down Expand Up @@ -996,7 +996,7 @@ def test_sync_binlog_stream_with_gtid(self,
with patch('tap_mysql.sync_strategies.binlog.singer.write_message') as write_msg:
write_msg.side_effect = lambda msg: singer_messages.append(msg)

with patch('tap_mysql.sync_strategies.binlog.CustomBinlogStreamReader',
with patch('tap_mysql.sync_strategies.binlog.BinLogStreamReader',
autospec=True) as reader_mock:
def iter_mock(_):
log_files = [
Expand Down

0 comments on commit 0db0b1b

Please sign in to comment.