fiuai-s3 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fiuai-s3 might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fiuai-s3
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: 一个支持阿里云OSS和MinIO的对象存储抽象包
5
5
  Project-URL: Homepage, https://github.com/fiuai-sz/fiuai-s3
6
6
  Project-URL: Repository, https://github.com/fiuai-sz/fiuai-s3.git
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fiuai-s3"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "一个支持阿里云OSS和MinIO的对象存储抽象包"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -166,8 +166,8 @@ class MinioStorage(ObjectStorage):
166
166
  def upload_doc_file(self,
167
167
  filename: str,
168
168
  data: bytes,
169
- doc_source_from: Optional[DocSourceFrom],
170
- doc_file_type: Optional[DocFileType],
169
+ doc_source_from: Optional[DocSourceFrom] = None,
170
+ doc_file_type: Optional[DocFileType] = None,
171
171
  tags: Optional[Dict[str, str]] = None,
172
172
  auth_tenant_id: Optional[str] = None,
173
173
  auth_company_id: Optional[str] = None,
@@ -176,17 +176,16 @@ class MinioStorage(ObjectStorage):
176
176
  上传单据文件,自动拼接存储路径并打tag
177
177
  """
178
178
  try:
179
-
180
179
  object_key = self._build_doc_path(filename, auth_tenant_id, auth_company_id, doc_id)
181
180
  # 将tags转换为Tags对象
182
181
  tags_obj = Tags()
183
182
  for k, v in tags.items():
184
183
  tags_obj[k] = v
185
184
 
186
- if doc_source_from:
187
- tags_obj["doc_source_from"] = doc_source_from.value
188
- if doc_file_type:
189
- tags_obj["doc_file_type"] = doc_file_type.value
185
+ doc_source_from = doc_source_from if doc_source_from else DocSourceFrom.OTHER
186
+ doc_file_type = doc_file_type if doc_file_type else DocFileType.OTHER
187
+ tags_obj["doc_source_from"] = doc_source_from.value
188
+ tags_obj["doc_file_type"] = doc_file_type.value
190
189
 
191
190
  self.client.put_object(
192
191
  bucket_name=self.bucket_name,
File without changes
File without changes
File without changes
File without changes