Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-93057: Deprecate positional use of optional sqlite3.connect() params#107948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedAug 14, 2023
edited by github-actionsbot
Loading

@erlend-aasland

This comment was marked as outdated.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

There is an issue here. Positional parameters are only deprecated in theConnection constructor. But we want also to deprecate them inconnect(). Currently you can bypass the deprecations if use theConnection subclass:

class MyConnection(Connection):    def __init__(self, database, timeout=5.0, ...):        super().__init__(database, timeout=timeout, ...)connect(":memory:", 10.0, ..., factory=MyConnection)

But if we add the second deprecation warning inconnect(), we will get two deprecation warning.

@erlend-aasland
Copy link
ContributorAuthor

There is an issue here. Positional parameters are only deprecated in theConnection constructor. But we want also to deprecate them inconnect(). Currently you can bypass the deprecations if use theConnection subclass:

Ah, of course. That's tricky.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Please add a test forconnect() and mention this change in What's New and NEWS entries.

It is a wart that we will get two warnings, but there is no simple way to avoid it, except applying deprecations one at a time -- first inconnect(), then (since 3.15) inConnection. Not sure if it it is worth.

We can also convert all positional arguments inconnect() into keyword arguments forfactory. It is a lot of complex code.

@erlend-aasland
Copy link
ContributorAuthor

We can also convert all positional arguments in connect() into keyword arguments for factory. It is a lot of complex code.

No, that is a backwards incompatible change.

@erlend-aasland
Copy link
ContributorAuthor

mention this change in What's New and NEWS entries.

Is the existing NEWS and What's New entries insufficient? In what way?

@serhiy-storchaka
Copy link
Member

Is the existing NEWS and What's New entries insufficient? In what way?

Ah, they already mention connect()! Then simply add "and the Connection constructor".

@erlend-aasland
Copy link
ContributorAuthor

Is the existing NEWS and What's New entries insufficient? In what way?

Ah, they already mention connect()! Then simply add "and the Connection constructor".

Yeah, that's useful information. I'll add that; thanks.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

erlend-aasland reacted with hooray emoji
@erlend-aasland
Copy link
ContributorAuthor

Thanks for the review, Serhiy. Much appreciated.

@erlend-aaslanderlend-aaslandenabled auto-merge (squash)August 15, 2023 07:40
@erlend-aaslanderlend-aasland merged commit13c36dc intopython:mainAug 15, 2023
@erlend-aaslanderlend-aasland deleted the sqlite/deprecate-optional-parameters branchAugust 15, 2023 08:13
@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedAug 15, 2023
edited
Loading

@felixxm, sorry, I forgot to ping you; I hope not these deprecations will create havoc for Django.

@felixxm
Copy link
Contributor

@felixxm, sorry, I forgot to ping you; I hope not these deprecations will create havoc for Django.

All good, Django doesn't pass these positional params, only a database name. Thanks 👍

erlend-aasland reacted with heart emoji

iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull requestAug 16, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

@Qadeem411Qadeem411Qadeem411 approved these changes

@berkerpeksagberkerpeksagAwaiting requested review from berkerpeksagberkerpeksag is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@erlend-aasland@serhiy-storchaka@felixxm@Qadeem411@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp