faust icon indicating copy to clipboard operation
faust copied to clipboard

orjson never used ?

Open elrik75 opened this issue 3 years ago • 1 comments

I found this code in utils/json.py

if typing.TYPE_CHECKING:
    import orjson
else:  # pragma: no cover
    orjson = None  # noqa

If I understand correctly, orjson is imported only when type checking ? Shouldn't it be the opposite ?

if not typing.TYPE_CHECKING:
    import orjson
...

elrik75 avatar Jan 12 '22 16:01 elrik75

This patch has removed the support of orjson:

https://github.com/faust-streaming/faust/commit/0addeb9f5e0f447abc98a68e2f80ef1b31ef6370#diff-5ed855992d723de7bd9e127e572d89dd5fa3ad03816c3ba52de5fd7be53ba7eeL30

I don't see why orjson support was removed, this patch is about converting collections.Counter into a dict. As orjson is way faster from the default lib, it could be great to try to reintroduce it. Or we must remove the install faust[orjson] setup.

elrik75 avatar Mar 01 '22 14:03 elrik75

This was reintroduced in https://github.com/faust-streaming/faust/pull/294.

wbarnha avatar Oct 13 '22 18:10 wbarnha