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 — bpo-45335: Add note to `sqlite3` docs about "timestamp" converter by iafisher · Pull Request #29200 · python/cpython

Conversation

@iafisher

@iafisher iafisher commented Oct 24, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

See https://discuss.python.org/t/fixing-sqlite-timestamp-converter-to-handle-utc-offsets/10985 for further discussion of this issue.

https://bugs.python.org/issue45335

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iafisher
bpo-45335: Add note to sqlite3 docs about "timestamp" converter
6b37eb6
@iafisher
iafisher requested a review from berkerpeksag as a code owner October 24, 2021 13:01
@bedevere-bot bedevere-bot added the awaiting review label Oct 24, 2021
@the-knights-who-say-ni

the-knights-who-say-ni commented Oct 24, 2021

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@iafisher

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Oct 24, 2021
@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Oct 24, 2021
@the-knights-who-say-ni the-knights-who-say-ni added CLA signed and removed CLA not signed labels Oct 27, 2021
@ambv
ambv requested a review from erlend-aasland October 28, 2021 19:40
ambv
ambv requested changes Oct 28, 2021
View reviewed changes
Comment thread Doc/library/sqlite3.rst Outdated
numbers, its value will be truncated to microsecond precision by the
timestamp converter.

.. warning::

@ambv ambv Oct 28, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We avoid using warnings in documentation. Instead we describe behavior using affirmative tone.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/sqlite3.rst Outdated
.. warning::

The "timestamp" converter ignores UTC offsets in the database and always
returns a naive :class:`datetime.datetime` object, so if you read a timestamp

@ambv ambv Oct 28, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of tutorials and howtos, we avoid addressing the reader as "you", instead using a style where the "you" is implied. Instead of saying:

If you want X, do Y.

simply say:

To achieve X, do Y.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@erlend-aasland erlend-aasland Oct 28, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'd drop that part of the sentence. The first part already says that UTC offsets are ignored; no need to exemplify it. How about something like this:

    The "timestamp" converter ignores UTC offsets in the database and always 
    returns a naive :class:`datetime.datetime` object. To preserve UTC offsets
    in timestamps, either leave converters disabled, or register offset-aware
    converters with :func:`register_converter`.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/sqlite3.rst Outdated
from the database with converters enabled and then write it back, any UTC
offset will be lost.

If you need to preserve UTC offsets in timestamps, then either leave

@ambv ambv Oct 28, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, instead of if..then just say "To preserve... either... or". This way you avoid the explicit "you".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot

bedevere-bot commented Oct 28, 2021

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting review labels Oct 28, 2021
@iafisher
Address comments from reviewers
e8572f7
@iafisher

iafisher commented Oct 28, 2021

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

Thank you for the review. I have used Erlend's wording with minor changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting changes label Oct 28, 2021
@bedevere-bot

bedevere-bot commented Oct 28, 2021

Copy link
Copy Markdown

Thanks for making the requested changes!

@ambv: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting change review label Oct 28, 2021
@bedevere-bot
bedevere-bot requested a review from ambv October 28, 2021 21:24
erlend-aasland
erlend-aasland approved these changes Oct 28, 2021
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iafisher

iafisher commented Oct 28, 2021

Copy link
Copy Markdown
Contributor Author

Should I backport this to older versions of Python as well? Is there documentation on how to do that?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland added needs backport to 3.9 labels Oct 28, 2021
@erlend-aasland

erlend-aasland commented Oct 28, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Should I backport this to older versions of Python as well? Is there documentation on how to do that?

Thanks for the reminder! I've added backport labels for @miss-islington :)

The devguide has a section about backporting.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland added the skip news label Oct 28, 2021
@iafisher

iafisher commented Oct 28, 2021

Copy link
Copy Markdown
Contributor Author

Thanks! Hopefully it can be backported automatically, but if not I'll check out the devguide.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv
ambv merged commit 3877fc0 into python:main Oct 29, 2021
@miss-islington

miss-islington commented Oct 29, 2021

Copy link
Copy Markdown
Contributor

Thanks @iafisher for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting change review label Oct 29, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 29, 2021
@iafisher @miss-islington
bpo-45335: Add note to sqlite3 docs about "timestamp" converter (py…
b1b563b
…thonGH-29200)

(cherry picked from commit 3877fc0)

Co-authored-by: Ian Fisher <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Oct 29, 2021
@bedevere-bot

bedevere-bot commented Oct 29, 2021

Copy link
Copy Markdown

GH-29319 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 29, 2021
@iafisher @miss-islington
bpo-45335: Add note to sqlite3 docs about "timestamp" converter (py…
ef4f47f
…thonGH-29200)

(cherry picked from commit 3877fc0)

Co-authored-by: Ian Fisher <[email protected]>
@bedevere-bot

bedevere-bot commented Oct 29, 2021

Copy link
Copy Markdown

GH-29320 is a backport of this pull request to the 3.9 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 label Oct 29, 2021
ambv pushed a commit that referenced this pull request Oct 29, 2021
@miss-islington @iafisher
bpo-45335: Add note to sqlite3 docs about "timestamp" converter (GH…
8ea665c
…-29200) (GH-29319)

(cherry picked from commit 3877fc0)

Co-authored-by: Ian Fisher <[email protected]>
ambv pushed a commit that referenced this pull request Oct 29, 2021
@miss-islington @iafisher
bpo-45335: Add note to sqlite3 docs about "timestamp" converter (GH…
e156031
…-29200) (GH-29320)

(cherry picked from commit 3877fc0)

Co-authored-by: Ian Fisher <[email protected]>
@iafisher iafisher mannequin mentioned this pull request May 16, 2022
Default TIMESTAMP converter in sqlite3 ignores UTC offset #89498
Closed
@erlend-aasland erlend-aasland mentioned this pull request Jul 27, 2022
Improve the sqlite3 reference #95273
Closed
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@ambv ambv Awaiting requested review from ambv

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@iafisher @the-knights-who-say-ni @bedevere-bot @erlend-aasland @miss-islington @ambv
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.