You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using JSONStorage, JSONStorage.read and JSONStorage.write should parse JSON with the custom compatible installed library. So, if I choose to install ujson, I expect that these two methods will use ujson.load and ujson.dump methods for JSON parsing.
Current Behavior
JSONStorage ignore custom JSON libraries and use the default json library, because the json library import is done by simply using:
Currently is not possible to change import json to from ...utils import json to automatically use the custom installed library (as done here or in lots of other files in the library), because aiogram/utils/json.py implements only dumps and loads methods. In order to use from ...utils import json, you would have to implement also dump and load methods.
The text was updated successfully, but these errors were encountered:
Context
Expected Behavior
When using JSONStorage,
JSONStorage.read
andJSONStorage.write
should parse JSON with the custom compatible installed library. So, if I choose to installujson
, I expect that these two methods will useujson.load
andujson.dump
methods for JSON parsing.Current Behavior
JSONStorage ignore custom JSON libraries and use the default
json
library, because the json library import is done by simply using:Possible solutions
I have found two possible solutions:
Change the import statement with something like:
Currently is not possible to change
import json
tofrom ...utils import json
to automatically use the custom installed library (as done here or in lots of other files in the library), because aiogram/utils/json.py implements onlydumps
andloads
methods. In order to usefrom ...utils import json
, you would have to implement alsodump
andload
methods.The text was updated successfully, but these errors were encountered: