[Breaking][Config] Restrict config value types to be compatible with ujson #3858
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#3858
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One type that comes to mind currently is ensuring integers are smaller than 2^64.
Is it worth breaking users instead of pushing them to use a different backend? If it is, why not something faster such as orjson or even simdjson?
Ujson was my mention here for availability, wheel for window will be out soon if it's not already, the whole push behind this one is aReJson driver 64-bit limit on ints , but ... if orjson was readily available to all system we support id prefer going with that. Simdjson never heard of it.
There's certainly some rules about allowed floats in ujson too, I know for sure that NaN and (+/-)inf don't work but there might be more restrictions.
We should also take a stance on what features of the library we choose are implementation details, for example:
ujsonallows custom objects to define__json__returning JSON string but no other json library does this which could lock us out if we don't say it's implementation detail.If this breaking change was purely for the integration of ujson, I wouldn't accept it.
Unless there was some proven big speedup, with numbers specific to our bot's performance, it wouldn't be worth the breaking change.
However, ujson aside, 64-bit integer restriction in config and some similar one for floats may be worth looking into if we finally want to take care of
inc(). At the moment I believe the postgres driver casts a JSON int into a bigint before doing any arithmetic, so naturally the int size is restricted to signed 64-bit there, if we enableinc(). Undoubtedly some other drivers would bring a similar restriction if they included nativeinc()functions.Overall I also think this would just improve consistency across future backends, since this restriction is not uncommon (take MongoDB for example).