Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-108278: Deprecate passing the first param of sqlite3.Connection callback APIs by keyword#108632
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -737,6 +737,27 @@ def test_aggr_text(self): | ||
| val = cur.fetchone()[0] | ||
| self.assertEqual(val, txt) | ||
| def test_agg_keyword_args(self): | ||
| regex = ( | ||
| r"Passing keyword arguments 'name', 'n_arg' and 'aggregate_class' to " | ||
| r"_sqlite3.Connection.create_aggregate\(\) is deprecated. " | ||
| r"Parameters 'name', 'n_arg' and 'aggregate_class' will become " | ||
| r"positional-only in Python 3.15." | ||
| ) | ||
| with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| self.con.create_aggregate("test", 1, aggregate_class=AggrText) | ||
| self.assertEqual(cm.filename, __file__) | ||
| with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| self.con.create_aggregate("test", n_arg=1, aggregate_class=AggrText) | ||
| self.assertEqual(cm.filename, __file__) | ||
| with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| self.con.create_aggregate(name="test", n_arg=0, | ||
| aggregate_class=AggrText) | ||
| self.assertEqual(cm.filename, __file__) | ||
| class AuthorizerTests(unittest.TestCase): | ||
| @staticmethod | ||
| @@ -779,6 +800,18 @@ def test_clear_authorizer(self): | ||
| self.con.execute("select * from t2") | ||
| self.con.execute("select c2 from t1") | ||
| def test_authorizer_keyword_args(self): | ||
| regex = ( | ||
| r"Passing keyword argument 'authorizer_callback' to " | ||
| r"_sqlite3.Connection.set_authorizer\(\) is deprecated. " | ||
| r"Parameter 'authorizer_callback' will become positional-only in " | ||
| r"Python 3.15." | ||
| ) | ||
| with self.assertWarnsRegex(DeprecationWarning, regex) as cm: | ||
| self.con.set_authorizer(authorizer_callback=lambda: None) | ||
| self.assertEqual(cm.filename, __file__) | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| class AuthorizerRaiseExceptionTests(AuthorizerTests): | ||
| @staticmethod | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Deprecate passing the callback callable by keyword for the following | ||
| :class:`sqlite3.Connection` APIs: | ||
| * :meth:`~sqlite3.Connection.set_authorizer` | ||
| * :meth:`~sqlite3.Connection.set_progress_handler` | ||
| * :meth:`~sqlite3.Connection.set_trace_callback` | ||
| The affected parameters will become positional-only in Python 3.15. | ||
| Patch by Erlend E. Aasland. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.