GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Deprecate default converters in sqlite3 · Issue #90016 · python/cpython

Deprecate default converters in sqlite3 #90016

New issue
Copy link
New issue
Copy link
Closed
#94276
Closed
Deprecate default converters in sqlite3#90016
#94276
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-sqlite3type-featureA feature request or enhancementA feature request or enhancement

Description

iafisher
mannequin
opened on Nov 21, 2021
Issue body actions
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

Next
  1. iafisher commented on Nov 21, 2021

    @iafisher
    iafishermannequin
    on Nov 21, 2021
    MannequinAuthor
    More actions

    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. iafisher
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Nov 21, 2021
  3. iafisher commented on Nov 21, 2021

    @iafisher
    iafishermannequin
    on Nov 21, 2021
    MannequinAuthor
    More actions

    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. Aasland
  4. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  5. erlend-aasland commented on May 16, 2022

    @erlend-aasland
    erlend-aasland
    on May 16, 2022
    Contributor
    More actions

    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:

    • 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

    1. I'm currently -1 on this ↩

  6. erlend-aasland
    added
    topic-sqlite3
    on May 16, 2022
  7. erlend-aasland
    added this to sqlite3 issueson May 21, 2022
  8. erlend-aasland
    moved this to In Progress in sqlite3 issueson May 21, 2022
  9. erlend-aasland
    added a commit that references this issue on May 23, 2022

    pythongh-90016: Reword sqlite3 adapter/converter docs

    598e26a
  10. erlend-aasland
    added 3 commits that reference this issue on Jun 25, 2022

    gh-90016: Reword sqlite3 adapter/converter docs (#93095)

    bd3c1c1

    [3.11] pythongh-90016: Reword sqlite3 adapter/converter docs (pythonG…

    64a385e

    [3.10] pythongh-90016: Reword sqlite3 adapter/converter docs (pythonG…

    c4e8ec9
  11. 3 remaining items

  12. erlend-aasland
    added
    type-featureA feature request or enhancementA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 25, 2022
  13. serhiy-storchaka
    added a commit that references this issue on Jun 26, 2022

    Revert 30935 defer bpo45162 to 312 (#94285)

    1ffde3e
  14. erlend-aasland commented on Jun 26, 2022

    @erlend-aasland
    erlend-aasland
    on Jun 26, 2022
    Contributor
    More actions

    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.

  15. erlend-aasland
    closed this as completedin #94276on Jul 20, 2022
  16. Repository owner moved this from In Progress to Done in sqlite3 issueson Jul 20, 2022
  17. erlend-aasland
    added a commit that references this issue on Jul 20, 2022

    gh-90016: Deprecate default sqlite3 adapters and converters (#94276)

    6dadf6c
  18. erlend-aasland commented on Jul 20, 2022

    @erlend-aasland
    erlend-aasland
    on Jul 20, 2022
    Contributor
    More actions

    Resolved by:

    • gh-90016: Reword sqlite3 adapter/converter docs #93095
    • [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
  19. felixxm
    added a commit that references this issue on Jul 21, 2022

    Stopped using default adapters/converters on SQLite backend.

    0e76abb
  20. Carreau
    added a commit that references this issue on Aug 28, 2023

    Fix DeprecationWarning on 3.12 with a datetime adapter for sqlite3 (#…

    46c7ccf
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/ directoryStandard Library Python modules in the Lib/ directorytopic-sqlite3type-featureA feature request or enhancementA feature request or enhancement

    Projects

    • sqlite3 issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.