Closed Jdsleppy closed 1 month ago
[X] I have checked that my issue does not already have a solution in the FAQ
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
0402b70adab62c937fcb647cb3f2d8f2aa08dc19
| Traceback (most recent call last): | File "/home/devuser/app/worker/scheduler.py", line 20, in run | event_broker = PsycopgEventBroker.from_async_sqla_engine(engine) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/home/devuser/.local/share/virtualenvs/app-KzUXTg0K/lib/python3.11/site-packages/apscheduler/eventbrokers/psycopg.py", line 88, in from_async_sqla_engine | conninfo = urlunparse( | ^^^^^^^^^^^ | File "/usr/lib64/python3.11/urllib/parse.py", line 514, in urlunparse | scheme, netloc, url, params, query, fragment, _coerce_result = ( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ValueError: not enough values to unpack (expected 7, got 6)
I believe this will always raise since APScheduler only passes in five objects, but urlunparse expects six.
urlunparse
The port is the missing thing.
Call PsycopgEventBroker.from_async_sqla_engine(engine) with any engine: AsyncEngine, for example:
PsycopgEventBroker.from_async_sqla_engine(engine)
engine: AsyncEngine
from sqlalchemy.ext.asyncio import create_async_engine from apscheduler.eventbrokers.psycopg import PsycopgEventBroker engine = create_async_engine("postgresql+psycopg://test:test@localhost:5432/test") PsycopgEventBroker.from_async_sqla_engine(engine) # Traceback (most recent call last): # File "<stdin>", line 1, in <module> # File "/home/devuser/.local/share/virtualenvs/app-KzUXTg0K/lib/python3.11/site-packages/apscheduler/eventbrokers/psycopg.py", line 88, in from_async_sqla_engine # conninfo = urlunparse( # ^^^^^^^^^^^ # File "/usr/lib64/python3.11/urllib/parse.py", line 514, in urlunparse # scheme, netloc, url, params, query, fragment, _coerce_result = ( # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # ValueError: not enough values to unpack (expected 7, got 6)
Things to check first
[X] I have checked that my issue does not already have a solution in the FAQ
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
Version
0402b70adab62c937fcb647cb3f2d8f2aa08dc19
What happened?
I believe this will always raise since APScheduler only passes in five objects, but
urlunparse
expects six.The port is the missing thing.
How can we reproduce the bug?
Call
PsycopgEventBroker.from_async_sqla_engine(engine)
with anyengine: AsyncEngine
, for example: