Skip to content
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

gh-69093: Support basic incremental I/O to blobs in sqlite3 #30680

Merged
merged 110 commits into from
Apr 15, 2022

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jan 19, 2022

Authored-by: Aviv Palivoda palaviv@gmail.com
Co-authored-by: Erlend E. Aasland erlend.aasland@innova.no

gh-69093

@JelleZijlstra
Copy link
Member

Some tests need to be updated with new error messages

@erlend-aasland
Copy link
Contributor Author

FYI, I'll prepare PRs for adding mapping protocol and context manager support.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Just two small comments; other than that, the docs look good to me! (With the caveat that I know very little about SQLite 😄)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

The docs LGTM!

@erlend-aasland
Copy link
Contributor Author

Thanks for reviewing, both of you :)

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Apr 14, 2022

BTW, I went over the review comments on the original PR; it seems that the following two comments by Berker are not addressed yet:

I think we should heed those suggestions. If you are ok with that, I'll fix those right away.

proposed patch
commit 69a5a1e2453710a34bfaf7863f94ea9dacefbedf (HEAD -> sqlite-blob-reduced)
Author: Erlend E. Aasland <erlend.aasland@innova.no>
Date:   Fri Apr 15 00:53:09 2022 +0200

    Address Berker's comments from gh-271: move __len__ doc to class description

diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 992256c134..d0274fb797 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -1115 +1115,2 @@ Blob Objects
-   data in an SQLite :abbr:`BLOB (Binary Large OBject)`.
+   data in an SQLite :abbr:`BLOB (Binary Large OBject)`.  Call ``len(blob)`` to
+   get the size (number of bytes) of the blob.
@@ -1125,4 +1125,0 @@ Blob Objects
-   .. method:: __len__()
-
-      Return the blob size in bytes.
-

commit 2590112aff8ec625aa5d1debb8fdc10f36fa3017
Author: Erlend E. Aasland <erlend.aasland@innova.no>
Date:   Fri Apr 15 00:52:47 2022 +0200

    Address Berker's comments from gh-271: remove unneeded class prefix

diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 0d4dbdf64d..992256c134 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -1117 +1117 @@ Blob Objects
-   .. method:: Blob.close()
+   .. method:: close()
@@ -1125 +1125 @@ Blob Objects
-   .. method:: Blob.__len__()
+   .. method:: __len__()
@@ -1129 +1129 @@ Blob Objects
-   .. method:: Blob.read(length=-1, /)
+   .. method:: read(length=-1, /)
@@ -1137 +1137 @@ Blob Objects
-   .. method:: Blob.write(data, /)
+   .. method:: write(data, /)
@@ -1143 +1143 @@ Blob Objects
-   .. method:: Blob.tell()
+   .. method:: tell()
@@ -1147 +1147 @@ Blob Objects
-   .. method:: Blob.seek(offset, origin=os.SEEK_SET, /)
+   .. method:: seek(offset, origin=os.SEEK_SET, /)

@JelleZijlstra
Copy link
Member

Sounds good, but I think your two patches conflict with each other.

JelleZijlstra added a commit to JelleZijlstra/typeshed that referenced this pull request Apr 15, 2022
- Blob from python/cpython#30680 (and anticipating that python/cpython#91550 will be merged)
- Aggregate window functions from python/cpython#20903
- Serialize/deserialize from python/cpython#26728
- Limit setting from python/cpython#28463
@erlend-aasland erlend-aasland deleted the sqlite-blob-reduced branch April 15, 2022 06:08
@palaviv
Copy link
Contributor

palaviv commented Apr 15, 2022

@erlend-aasland I wanted to say thank you for making this happen. Crazy it took more then 6 years to merge this...

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Apr 15, 2022

@erlend-aasland I wanted to say thank you for making this happen. Crazy it took more then 6 years to merge this...

Thanks for paving the way, and thanks for having done so much for the sqlite3 module. Yeah, PRs can end up hanging for years before being merged. Better late than never, I guess :)

(Also, I hope you're ok with the changes I've applied to your code.)

srittau pushed a commit to python/typeshed that referenced this pull request Apr 16, 2022
- Blob from python/cpython#30680 (and anticipating that python/cpython#91550 will be merged)
- Aggregate window functions from python/cpython#20903
- Serialize/deserialize from python/cpython#26728
- Limit setting from python/cpython#28463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants