feat: Python SDK update for version 20.0.0#147
Conversation
Greptile SummaryThis PR updates the Python SDK to align with Appwrite v20.0.0, introducing a new
Confidence Score: 5/5Safe to merge; all functional changes align with the documented v20.0.0 API surface and breaking changes are explicitly called out in the PR description. The new Organization service, enum renames, model field additions, and policy discriminator extensions are all consistent with the rest of the codebase's patterns. No new logic bugs were introduced beyond what was already flagged in previous review rounds. The only findings here are unused imports left over from the Generic/PrivateAttr refactoring in the Presence models and presences service. No files require special attention beyond the three unused-import suggestions in Important Files Changed
Reviews (2): Last reviewed commit: "chore: merge main and resolve version co..." | Re-trigger Greptile |
| api_params['providerBranches'] = self._normalize_value(provider_branches) | ||
| api_params['providerPaths'] = self._normalize_value(provider_paths) |
There was a problem hiding this comment.
Unconditional
None parameters silently clear VCS config on update
provider_branches and provider_paths are always added to api_params without a None guard, so any call to update() that omits these arguments will send None to the API. This differs from the create method, which correctly wraps these with if provider_branches is not None: guards (lines ~199–204). A PUT request sending None for both fields will erase any previously configured branch-filter and path-filter rules without the caller realising it.
| api_params['providerBranches'] = self._normalize_value(provider_branches) | |
| api_params['providerPaths'] = self._normalize_value(provider_paths) | |
| if provider_branches is not None: | |
| api_params['providerBranches'] = self._normalize_value(provider_branches) | |
| if provider_paths is not None: | |
| api_params['providerPaths'] = self._normalize_value(provider_paths) |
| api_params['providerBranches'] = self._normalize_value(provider_branches) | ||
| api_params['providerPaths'] = self._normalize_value(provider_paths) |
There was a problem hiding this comment.
Same unconditional
None issue in sites update()
provider_branches and provider_paths are added to api_params unconditionally in the update method, mirroring the same bug found in functions.py update. Any call to sites.update() that omits these parameters will send None to the API, potentially clearing existing branch/path filter configurations. The create method (lines ~206–209) correctly guards them with if ... is not None: checks.
| api_params['providerBranches'] = self._normalize_value(provider_branches) | |
| api_params['providerPaths'] = self._normalize_value(provider_paths) | |
| if provider_branches is not None: | |
| api_params['providerBranches'] = self._normalize_value(provider_branches) | |
| if provider_paths is not None: | |
| api_params['providerPaths'] = self._normalize_value(provider_paths) |
| with ThreadPoolExecutor(max_workers=8) as executor: | ||
| futures = [executor.submit(upload_remaining_chunk, chunk) for chunk in chunks[1:]] | ||
| for future in as_completed(futures): | ||
| future.result() |
There was a problem hiding this comment.
Parallel chunk upload: no cancellation on partial failure
Chunks 1..N are dispatched concurrently via ThreadPoolExecutor(max_workers=8). If any chunk raises (network error, server 5xx), its future.result() re-raises but the executor continues running all other already-submitted futures — there is no cancellation. The caller receives the exception only after all in-flight chunks have completed, wasting bandwidth and leaving the upload in an ambiguous state.
This PR contains updates to the Python SDK for version 20.0.0.