Skip to content

[BUG] TypeError: unsupported operand type(s) for |: 'type' and 'type' #183

@kopyl

Description

@kopyl

Bug Description

After running the tool I immediately got this error.

Steps to Reproduce

  1. Install with python3.9 -m pip install mysql_ch_replicator
  2. Run with python3.9 -m mysql_ch_replicator --config mysql_to_clickhouse_config.yaml db_replicator --db ridesharing --initial_only=True

Expected Behavior

A replication to happen, lol

Actual Behavior

$ python3.9 -m mysql_ch_replicator --config mysql_to_clickhouse_config.yaml db_replicator --db ridesharing --initial_only=True
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.9/3.9.23/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/homebrew/Cellar/python@3.9/3.9.23/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/homebrew/Cellar/python@3.9/3.9.23/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/opt/homebrew/lib/python3.9/site-packages/mysql_ch_replicator/__init__.py", line 1, in <module>
    from .main import main
  File "/opt/homebrew/lib/python3.9/site-packages/mysql_ch_replicator/main.py", line 9, in <module>
    from .config import Settings
  File "/opt/homebrew/lib/python3.9/site-packages/mysql_ch_replicator/config.py", line 34, in <module>
    class Index:
  File "/opt/homebrew/lib/python3.9/site-packages/mysql_ch_replicator/config.py", line 35, in Index
    databases: str | list = '*'
TypeError: unsupported operand type(s) for |: 'type' and 'type'

Environment

  • mysql_ch_replicator version:
  • Operating System: macOS
  • Python version: 3.9 as in the requirements

MySQL Configuration

# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1

Replicator Configuration

mysql:
  host: 'localhost'
  port: 3306
  user: 'root'
  password: ''

clickhouse:
  host: 'localhost'
  port: 8323
  user: 'default'
  password: 'default'

binlog_replicator:
  data_dir: '/Users/olehkopyl/Dropbox/Development/Veido/City-G/Projects/Jurny/Tasks/optimize-fare/clickhouse/clickhouse_data_dir'
  records_per_file: 100000

databases: 'ridesharing'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions