Repository navigation
Deprecate default converters in sqlite3 #90016
Description
Activity
Per discussion at https://discuss.python.org/t/fixing-sqlite-timestamp-converter-to-handle-utc-offsets/, the default converters in SQLite3 have several bugs and are probably not worth continuing to maintain, so I propose deprecating them and removing them in a later version of Python.
Since the converters are opt-in, this should not affect most users of SQLite3.
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Nov 21, 2021 See also bpo-26651 for a related proposal to deprecate the converter/adapter infrastructure entirely.
The proposal in this bug is more limited: remove the default converters (though I think the default adapters should stay), but continue to allow users to define their own converters.
Reacted by Erlend E. AaslandFor the record, I created a topic on Discourse, to raise more awareness before starting the deprecation process.
I propose to implement this in two (or possibly three) PRs:
- gh-90016: Reword sqlite3 adapter/converter docs #93095
Improve the docs by rewriting the section that deals with custom adapters and converters (reword existing example, add recipes for date/datetime converters). This PR should be backported to 3.11 and 3.10. - [3.11] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) #94272
- [3.10] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) #94273
- gh-90016: Deprecate default sqlite3 adapters and converters #94276
- Consider providing a set of date/datetime functions (that work as expected), but don't enable them by default (Serhiy's suggestion)1
Footnotes
-
I'm currently -1 on this ↩
- gh-90016: Reword sqlite3 adapter/converter docs #93095
- added a commit that references this issue
on May 23, 2022 3 remaining items
- addedtype-featureA feature request or enhancementA feature request or enhancementand removedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jun 25, 2022 - added a commit that references this issue
on Jun 26, 2022 GH-94276 adds deprecation warnings to the default converters/adapters themselves; that is, you'll get a deprecation warning when they're used. However, Ian suggested on the PR to also emit a deprecation warning at
connect(), ifdetect_typesis non-zero.If we are to do this, we should (must) detect if the default adapters and/or converters have been overridden or not.
I believe it may be worth the added complexity to provide a deprecation warning as early as possible. I'll provide a competing PR for this, so it is easier to visualise the added complexity.
OTOH, consider this scenario:
App Developer creates an app that adapts and converts all their custom Python objects. None of them are dates or timestamps, so there is no need for App Developer to override (or even care for) the default adapters. However, as of Python 3.12, they now get deprecation warnings at connect time even if they are not using the default adapters.
- added a commit that references this issue
on Jul 21, 2022 - added a commit that references this issue
on Aug 28, 2023
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: