Code Monkey home page Code Monkey logo

taskiq-faststream's People

Contributors

dependabot[bot] avatar lancetnik avatar s3rius avatar vvanglro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

taskiq-faststream's Issues

faststream import error

Hi!
I've got an import exception after updating the faststream package to 0.3.13

File "./app/taskiq.py", line 3, in <module>
    from taskiq_faststream import BrokerWrapper, StreamScheduler
  File "./venv/lib/python3.11/site-packages/taskiq_faststream/__init__.py", line 1, in <module>
    from taskiq_faststream.broker import AppWrapper, BrokerWrapper
  File "./venv/lib/python3.11/site-packages/taskiq_faststream/broker.py", line 5, in <module>
    from faststream._compat import TypeAlias, override
ImportError: cannot import name 'TypeAlias' from 'faststream._compat' (./venv/lib/python3.11/site-packages/faststream/_compat.py)

Packages:

taskiq-faststream==0.1.6
faststream==0.3.13

Validation error RabbitQueue

faststream = {extras = ["rabbit"], version = "^0.5.12"}
taskiq-faststream = {extras = ["rabbit"], version = "^0.1.8"}

from faststream.rabbit import RabbitQueue, RabbitExchange
from taskiq.schedule_sources import LabelScheduleSource
from taskiq_faststream import BrokerWrapper, StreamScheduler
from taskiq_faststream.types import ScheduledTask

from src.api.amqp.main import BROKER


taskiq_broker = BrokerWrapper(BROKER)

scheduler = StreamScheduler(
    broker=taskiq_broker,
    sources=[
        LabelScheduleSource(taskiq_broker)
    ],
)

taskiq_broker.task(
    queue=RabbitQueue(f'test', auto_delete=True),
    exchange=RabbitExchange('test', auto_delete=True),
    schedule=[
        ScheduledTask(cron='* * * * *')
    ],
)
[2024-06-22 17:58:20,587][INFO   ][run:run_scheduler:208] Startup completed.
[2024-06-22 17:58:20,588][INFO   ][run:delayed_send:130] Sending task taskiq_faststream.broker:lambda_09e8c474b85e4cf5a4e544b775f6544b.
[2024-06-22 17:59:00,011][ERROR  ][base_events:default_exception_handler:1821] Task exception was never retrieved
future: <Task finished name='Task-17' coro=<delayed_send() done, defined at /usr/local/lib/python3.12/site-packages/taskiq/cli/scheduler/run.py:106> exception=SendTaskError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/taskiq/kicker.py", line 138, in kiq
    await self.broker.kick(self.broker.formatter.dumps(message))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/taskiq/formatters/proxy_formatter.py", line 27, in dumps
    message=self.broker.serializer.dumpb(model_dump(message)),
                                         ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/taskiq/compat.py", line 31, in model_dump
    return instance.model_dump(mode="json")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 347, in model_dump
    return self.__pydantic_serializer__.to_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'faststream.rabbit.schemas.queue.RabbitQueue'>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/taskiq/cli/scheduler/run.py", line 131, in delayed_send
    await scheduler.on_ready(source, task)
  File "/usr/local/lib/python3.12/site-packages/taskiq_faststream/scheduler.py", line 24, in on_ready
    await LabelRespectKicker(task.task_name, self.broker, task.labels).kiq(
  File "/usr/local/lib/python3.12/site-packages/taskiq/kicker.py", line 140, in kiq
    raise SendTaskError from exc
taskiq.exceptions.SendTaskError
[2024-06-22 17:59:00,015][INFO   ][run:delayed_send:130] Sending task taskiq_faststream.broker:lambda_09e8c474b85e4cf5a4e544b775f6544b.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.