Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression from #2148 #2165

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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