PYTHON-3916 Deprecate Deprecated GridFS Fields, remove in 5.0 (#1379)

This commit is contained in:
Noah Stapp 2023-09-19 10:41:24 -07:00 committed by GitHub
parent db4406b951
commit 611303ac00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,14 +235,18 @@ class GridIn:
_id: Any = _grid_in_property("_id", "The ``'_id'`` value for this file.", read_only=True)
filename: Optional[str] = _grid_in_property("filename", "Name of this file.")
name: Optional[str] = _grid_in_property("filename", "Alias for `filename`.")
content_type: Optional[str] = _grid_in_property("contentType", "Mime-type for this file.")
content_type: Optional[str] = _grid_in_property(
"contentType", "DEPRECATED, will be removed in PyMongo 5.0. Mime-type for this file."
)
length: int = _grid_in_property("length", "Length (in bytes) of this file.", closed_only=True)
chunk_size: int = _grid_in_property("chunkSize", "Chunk size for this file.", read_only=True)
upload_date: datetime.datetime = _grid_in_property(
"uploadDate", "Date that this file was uploaded.", closed_only=True
)
md5: Optional[str] = _grid_in_property(
"md5", "MD5 of the contents of this file if an md5 sum was created.", closed_only=True
"md5",
"DEPRECATED, will be removed in PyMongo 5.0. MD5 of the contents of this file if an md5 sum was created.",
closed_only=True,
)
_buffer: io.BytesIO
@ -476,18 +480,23 @@ class GridOut(io.IOBase):
_id: Any = _grid_out_property("_id", "The ``'_id'`` value for this file.")
filename: str = _grid_out_property("filename", "Name of this file.")
name: str = _grid_out_property("filename", "Alias for `filename`.")
content_type: Optional[str] = _grid_out_property("contentType", "Mime-type for this file.")
content_type: Optional[str] = _grid_out_property(
"contentType", "DEPRECATED, will be removed in PyMongo 5.0. Mime-type for this file."
)
length: int = _grid_out_property("length", "Length (in bytes) of this file.")
chunk_size: int = _grid_out_property("chunkSize", "Chunk size for this file.")
upload_date: datetime.datetime = _grid_out_property(
"uploadDate", "Date that this file was first uploaded."
)
aliases: Optional[list[str]] = _grid_out_property("aliases", "List of aliases for this file.")
aliases: Optional[list[str]] = _grid_out_property(
"aliases", "DEPRECATED, will be removed in PyMongo 5.0. List of aliases for this file."
)
metadata: Optional[Mapping[str, Any]] = _grid_out_property(
"metadata", "Metadata attached to this file."
)
md5: Optional[str] = _grid_out_property(
"md5", "MD5 of the contents of this file if an md5 sum was created."
"md5",
"DEPRECATED, will be removed in PyMongo 5.0. MD5 of the contents of this file if an md5 sum was created.",
)
_file: Any