add back orjson
This commit is contained in:
@ -1,4 +1,7 @@
|
|||||||
import json
|
try:
|
||||||
|
import orjson as json
|
||||||
|
except ImportError: # pragma: no cover
|
||||||
|
import json # type: ignore
|
||||||
import uuid
|
import uuid
|
||||||
from typing import (
|
from typing import (
|
||||||
AbstractSet,
|
AbstractSet,
|
||||||
@ -370,10 +373,10 @@ class NewBaseModel(
|
|||||||
|
|
||||||
if condition:
|
if condition:
|
||||||
try:
|
try:
|
||||||
return operand(value)
|
value = operand(value)
|
||||||
except TypeError: # pragma no cover
|
except TypeError: # pragma no cover
|
||||||
pass
|
pass
|
||||||
return value
|
return value.decode("utf-8") if isinstance(value, bytes) else value
|
||||||
|
|
||||||
def _is_conversion_to_json_needed(self, column_name: str) -> bool:
|
def _is_conversion_to_json_needed(self, column_name: str) -> bool:
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user