Skip to content

Commit

Permalink
Fix regression from #2148 (#2165)
Browse files Browse the repository at this point in the history
* Fix regression from #2148.

Fixes #2157.

* Fix linter error.
  • Loading branch information
Omer Katz authored Oct 21, 2024
1 parent 2a206a1 commit 7e4f1bb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
8 changes: 8 additions & 0 deletions kombu/transport/sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ def _engine_from_config(self):
transport_options = conninfo.transport_options.copy()
transport_options.pop('queue_tablename', None)
transport_options.pop('message_tablename', None)
transport_options.pop('callback', None)
transport_options.pop('errback', None)
transport_options.pop('max_retries', None)
transport_options.pop('interval_start', None)
transport_options.pop('interval_step', None)
transport_options.pop('interval_max', None)
transport_options.pop('retry_errors', None)

return create_engine(conninfo.hostname, **transport_options)

def _open(self):
Expand Down
15 changes: 13 additions & 2 deletions t/unit/transport/test_sqlalchemy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from __future__ import annotations

from unittest.mock import patch
from unittest.mock import Mock, patch

import pytest

from kombu import Connection
from kombu.exceptions import OperationalError

pytest.importorskip('sqlalchemy')

Expand All @@ -24,7 +25,17 @@ def test_url_parser(self):
Connection(url).connect()

def test_simple_queueing(self):
conn = Connection('sqlalchemy+sqlite:///:memory:')
conn = Connection(
'sqlalchemy+sqlite:///:memory:',
transport_options={
"callback": Mock(),
"errback": Mock(),
"max_retries": 20,
"interval_start": 1,
"interval_step": 2,
"interval_max": 30,
"retry_errors": (OperationalError,)
})
conn.connect()
try:
channel = conn.channel()
Expand Down

0 comments on commit 7e4f1bb

Please sign in to comment.