We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55e3359 commit a374227Copy full SHA for a374227
1 file changed
src/PowerPlatform/Dataverse/aio/data/_async_upload.py
@@ -6,6 +6,7 @@
6
from __future__ import annotations
7
8
import asyncio
9
+import math
10
from pathlib import Path
11
from typing import Optional
12
from urllib.parse import quote
@@ -172,7 +173,7 @@ async def _upload_file_chunk(
172
173
effective_size = recommended_size or (4 * 1024 * 1024)
174
if effective_size <= 0:
175
raise ValueError("effective chunk size must be positive")
- total_chunks = (total_size + effective_size - 1) // effective_size if total_size else 1
176
+ total_chunks = int(math.ceil(total_size / effective_size)) if total_size else 1
177
uploaded_bytes = 0
178
with p.open("rb") as fh:
179
for _ in range(total_chunks):
0 commit comments