Sitelet https://github.com/python/cpython/issues/90016
Skip to content

Deprecate default converters in sqlite3 #90016

Description

@iafisher
mannequin
BPO 45858
Nosy @ethanfurman, @erlend-aasland, @iafisher, @Strongbeard

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:

assignee = None
closed_at = None
created_at = <Date 2021-11-21.16:46:00.409>
labels = ['type-bug', 'library']
title = 'Deprecate default converters in sqlite3'
updated_at = <Date 2021-11-22.06:16:52.009>
user = 'https://github.com/iafisher'

bugs.python.org fields:

activity = <Date 2021-11-22.06:16:52.009>
actor = 'Strongbeard'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-11-21.16:46:00.409>
creator = 'iafisher'
dependencies = []
files = []
hgrepos = []
issue_num = 45858
keywords = []
message_count = 2.0
messages = ['406727', '406728']
nosy_count = 4.0
nosy_names = ['ethan.furman', 'erlendaasland', 'iafisher', 'Strongbeard']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45858'
versions = []

Activity

  1. iafisher commented on Nov 21, 2021

    iafishermannequin
    MannequinAuthor

    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.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or error
    on Nov 21, 2021
  3. iafisher commented on Nov 21, 2021

    iafishermannequin
    MannequinAuthor

    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.

  4. transferred this issue fromon Apr 10, 2022
  5. erlend-aasland commented on May 16, 2022

    @erlend-aasland
    Contributor

    For 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:

    Footnotes

    1. I'm currently -1 on this ↩

  6. moved this to In Progress in sqlite3 issueson May 21, 2022
  7. added a commit that references this issue on May 23, 2022
  8. added 3 commits that reference this issue on Jun 25, 2022
  9. 3 remaining items

  10. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Jun 25, 2022
  11. erlend-aasland commented on Jun 26, 2022

    @erlend-aasland
    Contributor

    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(), if detect_types is 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.

  12. Repository owner moved this from In Progress to Done in sqlite3 issueson Jul 20, 2022
  13. added a commit that references this issue on Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-sqlite3type-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions