-
Notifications
You must be signed in to change notification settings - Fork 66
Updates: sync as per latest cloud specs #129
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
base: main
Are you sure you want to change the base?
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request updates the Python SDK from version 14.1.0 to 14.1.1. Changes include introducing two new service classes (Backups and Organizations), removing the Output enum in favor of ImageFormat in image-related services, deprecating three Deno runtime versions, adding new OAuth providers and Name enum members, extending the Account and Health services with new optional parameters and methods, and modifying the Databases service to make the data parameter optional in upsert_document. Corresponding documentation examples and setup metadata are updated to reflect the version bump and new functionality. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In `@appwrite/services/account.py`:
- Line 1231: The enum listing OAuth2 providers includes "githubImagine" and
"googleImagine" with no documentation—determine whether these are production
providers or test-only artifacts and either (A) add a clear doc comment above
the enum (or next to the specific values) explaining their purpose and intended
usage (e.g., "test-only/mock providers used for internal integration testing;
not for production"), or (B) remove the "githubImagine" and "googleImagine"
entries from the enum if they are only test artifacts; if you remove them, also
update any tests, fixtures, or reference code that expect those values (search
for "githubImagine" and "googleImagine" across the repo and update docs/tests
accordingly) and ensure the enum docstring reflects the final set of supported
providers.
In `@appwrite/services/organizations.py`:
- Around line 15-18: The docstring for the parameter organization_id is
inconsistent (it says "Team ID"); update the parameter description in the
docstring to read "Organization ID" so it matches the parameter name
organization_id and improves clarity (locate the docstring in
appwrite.services.organizations where organization_id is documented and replace
"Team ID" with "Organization ID").
- Around line 47-50: Update the docstring for the function in
appwrite/services/organizations.py that declares the parameter organization_id
so the parameter description reads "Organization ID" instead of "Team ID";
locate the docstring that documents the organization_id parameter (same place
where delete had the mismatch) and replace the incorrect "Team ID" text with
"Organization ID" to keep docs consistent.
In `@appwrite/services/storage.py`:
- Around line 441-443: The permissions value is always being sent even when None
which can override inherited permissions; change the code that builds api_params
to only set api_params['permissions'] = permissions when permissions is not None
(mirroring the existing conditional for name), i.e., add a conditional check
around the permissions assignment so permissions is only included in api_params
when not None.
🧹 Nitpick comments (12)
README.md (1)
9-9: Consider specifying a concrete version number for the compatibility note.Stating compatibility with "Appwrite server version latest" may become ambiguous over time. Consider specifying the exact server version (e.g., "1.8.x") for clearer compatibility guidance, as was done in the previous version.
appwrite/services/avatars.py (1)
10-10: Remove unnecessary semicolon.Python does not require semicolons at end of statements.
Proposed fix
-from ..enums.image_format import ImageFormat; +from ..enums.image_format import ImageFormatdocs/examples/account/create-jwt.md (1)
11-13: Consider using a meaningful example value forduration.The example uses
duration = 0, which may produce an immediately expiring JWT or be rejected by the API. According to the docstring, the default is 900 seconds and max is 3600 seconds. A value likeduration = 1800(30 minutes) would be a more practical example.Proposed fix
result = account.create_jwt( - duration = 0 # optional + duration = 1800 # optional )appwrite/services/organizations.py (1)
1-4: Unused imports.
List,Optional, anddeprecatedare imported but not used in this module.🧹 Suggested cleanup
from ..service import Service -from typing import List, Dict, Any, Optional +from typing import Dict, Any from ..exception import AppwriteException -from appwrite.utils.deprecated import deprecatedappwrite/services/backups.py (4)
1-9: Unused import:deprecated.The
deprecateddecorator is imported but never used in this module.Proposed fix
from ..service import Service from typing import List, Dict, Any, Optional from ..exception import AppwriteException -from appwrite.utils.deprecated import deprecated
68-69: Inconsistent handling of optionalresource_idparameter.
resource_idis always added toapi_paramseven whenNone, unlike other optional parameters in this file (e.g.,queriesinlist_archives). This inconsistency could send unnecessarynullvalues to the API.Proposed fix
api_params['services'] = services - api_params['resourceId'] = resource_id + if resource_id is not None: + api_params['resourceId'] = resource_id
214-222: Same inconsistency withresource_idparameter.Line 218 adds
resourceIdunconditionally whilenameandenabledare conditionally added. Apply the same pattern for consistency.Proposed fix
api_params['policyId'] = policy_id if name is not None: api_params['name'] = name api_params['services'] = services - api_params['resourceId'] = resource_id + if resource_id is not None: + api_params['resourceId'] = resource_id if enabled is not None: api_params['enabled'] = enabled api_params['retention'] = retention api_params['schedule'] = schedule
294-298: Inconsistent handling of optional parameters inupdate_policy.
scheduleis conditionally added (line 296-297), butname,retention, andenabledare added unconditionally, potentially sendingNonevalues. Since all parameters are optional in an update operation, they should all be handled consistently.Proposed fix
- api_params['name'] = name - api_params['retention'] = retention + if name is not None: + api_params['name'] = name + if retention is not None: + api_params['retention'] = retention if schedule is not None: api_params['schedule'] = schedule - api_params['enabled'] = enabled + if enabled is not None: + api_params['enabled'] = enableddocs/examples/backups/create-archive.md (1)
11-14: Provide a meaningful example forservices.An empty array
[]passes validation but creates a backup of nothing. Consider showing a realistic example with actual service values to guide users.Proposed fix
result = backups.create_archive( - services = [], + services = ['databases'], # e.g., 'databases', 'storage', etc. resource_id = '<RESOURCE_ID>' # optional )docs/examples/backups/create-policy.md (2)
13-13: Consider using a more illustrative services example.The empty list
services = []might not clearly demonstrate to users what should be included. Backup policies typically need to specify at least one service to back up.💡 Suggested improvement
Consider showing an example with actual service names:
- services = [], + services = ['database', 'storage'], # e.g., database, storage, functions
15-15: Consider using a cron expression for the schedule parameter.The empty string
schedule = ''doesn't demonstrate the expected format. Appwrite backup policies require cron expressions (5 space-separated fields: minute hour day month weekday).💡 Suggested improvement
Use a realistic cron expression such as:
- schedule = '', + schedule = '0 0 * * *', # daily at midnightOther examples:
'*/15 * * * *'(every 15 minutes),'0 * * * *'(hourly),'0 0 * * 1'(every Monday at midnight).docs/examples/databases/update-documents.md (1)
14-20: Good improvement with populated example data.The switch from an empty dictionary to a realistic payload makes the example more helpful.
However, note that the
agefield is set to33here, while indocs/examples/databases/upsert-document.mdit's set to30for the same user. Consider standardizing the age value across all examples featuring walter.obrien for consistency.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (48)
CHANGELOG.mdLICENSEREADME.mdappwrite/client.pyappwrite/encoders/value_class_encoder.pyappwrite/enums/build_runtime.pyappwrite/enums/name.pyappwrite/enums/o_auth_provider.pyappwrite/enums/output.pyappwrite/enums/runtime.pyappwrite/operator.pyappwrite/query.pyappwrite/service.pyappwrite/services/account.pyappwrite/services/avatars.pyappwrite/services/backups.pyappwrite/services/databases.pyappwrite/services/health.pyappwrite/services/organizations.pyappwrite/services/storage.pydocs/examples/account/create-jwt.mddocs/examples/avatars/get-screenshot.mddocs/examples/backups/create-archive.mddocs/examples/backups/create-policy.mddocs/examples/backups/create-restoration.mddocs/examples/backups/delete-archive.mddocs/examples/backups/delete-policy.mddocs/examples/backups/get-archive.mddocs/examples/backups/get-policy.mddocs/examples/backups/get-restoration.mddocs/examples/backups/list-archives.mddocs/examples/backups/list-policies.mddocs/examples/backups/list-restorations.mddocs/examples/backups/update-policy.mddocs/examples/databases/update-document.mddocs/examples/databases/update-documents.mddocs/examples/databases/upsert-document.mddocs/examples/health/get-queue-billing-project-aggregation.mddocs/examples/health/get-queue-billing-team-aggregation.mddocs/examples/health/get-queue-priority-builds.mddocs/examples/health/get-queue-region-manager.mddocs/examples/health/get-queue-threats.mddocs/examples/organizations/delete.mddocs/examples/organizations/estimation-delete-organization.mddocs/examples/tablesdb/update-row.mddocs/examples/tablesdb/update-rows.mddocs/examples/tablesdb/upsert-row.mdsetup.py
💤 Files with no reviewable changes (6)
- appwrite/enums/runtime.py
- appwrite/enums/build_runtime.py
- appwrite/enums/output.py
- appwrite/service.py
- appwrite/operator.py
- appwrite/query.py
🧰 Additional context used
🧬 Code graph analysis (5)
appwrite/services/organizations.py (5)
appwrite/service.py (1)
Service(3-5)appwrite/exception.py (1)
AppwriteException(1-7)appwrite/utils/deprecated.py (1)
deprecated(11-51)appwrite/services/databases.py (1)
delete(378-410)appwrite/client.py (1)
call(75-141)
appwrite/services/avatars.py (2)
appwrite/enums/image_format.py (1)
ImageFormat(3-10)appwrite/enums/theme.py (1)
Theme(3-5)
appwrite/services/health.py (1)
appwrite/client.py (1)
call(75-141)
appwrite/services/account.py (1)
appwrite/services/users.py (1)
create_jwt(655-693)
appwrite/encoders/value_class_encoder.py (1)
appwrite/enums/image_format.py (1)
ImageFormat(3-10)
🪛 LanguageTool
README.md
[style] ~11-~11: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help ...
(EN_WEAK_ADJECTIVE)
[grammar] ~11-~11: Use a hyphen to join words.
Context: ...e development tasks behind a very simple to use REST API. Appwrite aims to help y...
(QB_NEW_EN_HYPHEN)
[grammar] ~11-~11: Use a hyphen to join words.
Context: ...evelopment tasks behind a very simple to use REST API. Appwrite aims to help you ...
(QB_NEW_EN_HYPHEN)
🪛 markdownlint-cli2 (0.18.1)
docs/examples/tablesdb/update-rows.md
19-19: Bare URL used
(MD034, no-bare-urls)
docs/examples/tablesdb/upsert-row.md
19-19: Bare URL used
(MD034, no-bare-urls)
🪛 Ruff (0.14.11)
appwrite/services/organizations.py
34-34: Avoid specifying long messages outside the exception class
(TRY003)
66-66: Avoid specifying long messages outside the exception class
(TRY003)
appwrite/services/avatars.py
10-10: Statement ends with an unnecessary semicolon
Remove unnecessary semicolon
(E703)
appwrite/services/backups.py
65-65: Avoid specifying long messages outside the exception class
(TRY003)
98-98: Avoid specifying long messages outside the exception class
(TRY003)
129-129: Avoid specifying long messages outside the exception class
(TRY003)
202-202: Avoid specifying long messages outside the exception class
(TRY003)
205-205: Avoid specifying long messages outside the exception class
(TRY003)
208-208: Avoid specifying long messages outside the exception class
(TRY003)
211-211: Avoid specifying long messages outside the exception class
(TRY003)
251-251: Avoid specifying long messages outside the exception class
(TRY003)
290-290: Avoid specifying long messages outside the exception class
(TRY003)
327-327: Avoid specifying long messages outside the exception class
(TRY003)
365-365: Avoid specifying long messages outside the exception class
(TRY003)
368-368: Avoid specifying long messages outside the exception class
(TRY003)
434-434: Avoid specifying long messages outside the exception class
(TRY003)
🔇 Additional comments (46)
appwrite/enums/name.py (1)
14-14: LGTM!The new
V1_SCREENSHOTSenum member follows the established naming conventions and is consistent with the existing members in theNameenum.appwrite/services/health.py (5)
146-173: LGTM!The
get_queue_billing_project_aggregationmethod follows the established pattern used by other queue methods in this service. The implementation correctly:
- Defines the API path
- Conditionally adds the optional
thresholdparameter- Returns the result of
client.call()
175-202: LGTM!The
get_queue_billing_team_aggregationmethod is consistent with the billing project aggregation method and follows the same pattern.
233-260: LGTM!The
get_queue_priority_buildsmethod correctly maps to the/health/queue/builds-priorityendpoint. The documented default threshold of 500 differs from other endpoints (5000), which is appropriately documented in the docstring.
534-561: LGTM!The
get_queue_region_managermethod follows the established pattern. The lower default threshold (100) is correctly documented in the docstring.
621-648: LGTM!The
get_queue_threatsmethod is implemented correctly with the same pattern as other queue methods. The default threshold of 100 is appropriately documented.docs/examples/health/get-queue-priority-builds.md (1)
1-13: LGTM!The example correctly demonstrates how to use the new
get_queue_priority_buildsmethod with the optional threshold parameter. The pattern is consistent with other SDK documentation examples.docs/examples/health/get-queue-threats.md (1)
1-13: LGTM!The example correctly demonstrates how to use the new
get_queue_threatsmethod with the optional threshold parameter.docs/examples/health/get-queue-region-manager.md (1)
1-13: LGTM!The example correctly demonstrates how to use the new
get_queue_region_managermethod with the optional threshold parameter.docs/examples/health/get-queue-billing-team-aggregation.md (1)
1-13: LGTM!The example correctly demonstrates how to use the new
get_queue_billing_team_aggregationmethod with the optional threshold parameter. The pattern is consistent with the other health queue endpoint examples.docs/examples/health/get-queue-billing-project-aggregation.md (1)
11-13: [Unable to complete verification due to repository access failure. Manual verification required to assess pattern consistency across other Health method documentation examples.]LICENSE (1)
1-1: LGTM!Copyright year updated to 2026, which is appropriate for the current year.
docs/examples/backups/delete-archive.md (1)
1-13: LGTM!Clear and well-structured documentation example for the new Backups service. The pattern is consistent with other SDK examples.
appwrite/client.py (1)
18-22: LGTM!Version headers consistently updated to 14.1.1, aligning with the SDK release.
appwrite/services/storage.py (1)
69-77: LGTM!Documentation updates correctly reflect the increased maximum file size (5GB) and updated compression algorithm descriptions.
appwrite/encoders/value_class_encoder.py (2)
10-10: LGTM!Import correctly updated from
OutputtoImageFormat, aligning with the SDK-wide transition to the new enum.
66-67: LGTM!Serialization handler correctly updated to check for
ImageFormatinstances.docs/examples/tablesdb/update-rows.md (1)
14-20: LGTM!The populated data payload provides a clearer, more practical example for users compared to an empty object. The field types (string, integer, boolean) effectively demonstrate the variety of data that can be updated.
docs/examples/backups/list-restorations.md (1)
1-13: LGTM!The example follows the established SDK documentation pattern and correctly demonstrates the new Backups service usage for listing restorations.
docs/examples/databases/update-document.md (1)
17-23: LGTM!The populated data payload is consistent with the other documentation examples updated in this PR, providing users with a realistic example of document updates.
appwrite/services/databases.py (1)
2773-2827: data parameter correctly made optional in upsert_document.The change to make
dataoptional aligns with theupdate_documentmethod pattern and the server API specification. The conditionalif data is not Nonecheck properly handles the optional parameter, and the implementation is consistent with how other update methods in the service handle optional data fields.appwrite/enums/o_auth_provider.py (1)
44-46: LGTM!The new OAuth provider enum members follow the established naming conventions in this file. The value strings use camelCase consistent with existing multi-word providers like
paypalSandboxandtradeshiftBox. ThegithubImagineandgoogleImagineproviders are documented in the Account service as supported providers, andMOCK_UNVERIFIEDfollows the pattern of the existingMOCKprovider for testing purposes.README.md (2)
4-4: LGTM!Version badge correctly updated to 1.8.1, aligning with the SDK version bump.
11-11: LGTM!Grammar improvements correctly applied ("abstracts and simplifies").
appwrite/services/avatars.py (1)
320-320: LGTM!The
outputparameter type correctly updated fromOutputtoImageFormat, which is more descriptive for image format options. The docstring is properly aligned with the type hint.Also applies to: 368-368
docs/examples/avatars/get-screenshot.md (1)
5-5: LGTM!Documentation example correctly updated to use
ImageFormatinstead ofOutput, consistent with the API changes inavatars.py.Also applies to: 37-37
appwrite/services/account.py (1)
188-216: LGTM!The
create_jwtmethod correctly implements the optionaldurationparameter, consistent with the pattern used inusers.py(lines 654-692). The docstring properly documents the default (900s) and maximum (3600s) values.setup.py (1)
11-21: LGTM!Version bump to 14.1.1 is consistent across
versionanddownload_url. The grammar fix in the description ("abstracts and simplifies") is also correct.CHANGELOG.md (1)
3-5: LGTM!The changelog entry follows the established format and maintains reverse chronological order. The entry is consistent with the PR description.
appwrite/services/organizations.py (2)
31-41: LGTM!The method implementation follows the established pattern used by other service methods in the SDK (e.g.,
databases.delete). Path construction, parameter validation, and API call are correct.
43-45: Verify: PATCH method for a "get estimation" operation.The docstring describes this as getting an estimation, but the implementation uses PATCH (typically for partial updates). If this matches the server API specification, it's fine. Otherwise, consider if GET would be more appropriate for a read-only estimation operation.
Also applies to: 71-73
docs/examples/organizations/estimation-delete-organization.md (1)
1-13: LGTM!The documentation example correctly demonstrates how to use the new
estimation_delete_organizationmethod, following the established pattern for SDK examples.docs/examples/organizations/delete.md (1)
1-13: LGTM!The documentation example correctly demonstrates how to use the new
deletemethod on the Organizations service, following the established pattern for SDK examples.appwrite/services/backups.py (3)
11-38: LGTM!The
list_archivesmethod correctly handles the optionalqueriesparameter and follows consistent SDK patterns.
75-165: LGTM!The
get_archive,delete_archive, andlist_policiesmethods correctly validate required parameters and handle optional parameters consistently.
304-439: LGTM!The
delete_policy,create_restoration,list_restorations, andget_restorationmethods correctly validate required parameters and handle optional parameters consistently.docs/examples/backups/get-archive.md (1)
1-13: LGTM!The example clearly demonstrates how to retrieve a backup archive using the SDK.
docs/examples/backups/get-policy.md (1)
1-13: LGTM!The example clearly demonstrates how to retrieve a backup policy using the SDK.
docs/examples/backups/get-restoration.md (1)
1-13: LGTM!The example clearly demonstrates how to retrieve a restoration status using the SDK.
docs/examples/backups/list-policies.md (1)
1-13: LGTM!The example follows the standard documentation pattern and correctly demonstrates the
list_policiesmethod usage with an optionalqueriesparameter.docs/examples/backups/list-archives.md (1)
1-13: LGTM!The example is consistent with other Backups documentation and correctly demonstrates the
list_archivesmethod usage.docs/examples/backups/delete-policy.md (1)
1-13: LGTM!The example is clear and demonstrates the
delete_policymethod correctly with the requiredpolicy_idparameter.docs/examples/backups/create-restoration.md (1)
1-16: LGTM! Clear example for the new Backups service.The example correctly demonstrates the create_restoration method with required and optional parameters, following the established documentation pattern.
docs/examples/tablesdb/update-row.md (1)
17-23: LGTM! Populated payload improves example clarity.The realistic data payload is more instructive than an empty dictionary. Note that this example uses
age: 33, which should ideally align with the age value used in other walter.obrien examples (see upsert-document.md which usesage: 30).docs/examples/databases/upsert-document.md (1)
17-23: Good example enhancement with populated data.The realistic payload is much more useful for developers than an empty object. Minor note: the
agevalue is30here but33in related examples (update-documents.md, update-row.md, upsert-row.md). While this doesn't affect functionality, consistency across examples would be ideal.docs/examples/tablesdb/upsert-row.md (1)
17-23: LGTM! Realistic example payload.The populated data dictionary provides a clearer example for developers. Minor consistency note: the
ageis33here and in other update examples, but30in upsert-document.md. Consider aligning for uniformity across the walter.obrien examples.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| ---------- | ||
| provider : OAuthProvider | ||
| OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. | ||
| OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for usage of these OAuth provider names in the codebase
rg -n "githubImagine|googleImagine" --type pyRepository: appwrite/sdk-for-python
Length of output: 681
🏁 Script executed:
cat -n appwrite/enums/o_auth_provider.pyRepository: appwrite/sdk-for-python
Length of output: 1482
🏁 Script executed:
rg -i "imagine" -n --type py --type md -A 2Repository: appwrite/sdk-for-python
Length of output: 1120
🏁 Script executed:
fd -type f -name "*.md" -o -name "*.txt" | head -20Repository: appwrite/sdk-for-python
Length of output: 237
🏁 Script executed:
rg -i "oauth.*provider" --type md -A 3 | head -50Repository: appwrite/sdk-for-python
Length of output: 746
🏁 Script executed:
find . -name "README*" -o -name "CHANGELOG*" | head -10Repository: appwrite/sdk-for-python
Length of output: 93
🏁 Script executed:
rg "githubImagine|googleImagine" -iRepository: appwrite/sdk-for-python
Length of output: 670
🏁 Script executed:
grep -n "Imagine" ./CHANGELOG.md | head -20Repository: appwrite/sdk-for-python
Length of output: 49
Add documentation clarifying the purpose of "githubImagine" and "googleImagine" providers, or remove them if they are test-only.
These OAuth providers are formally defined in the enum but lack any documentation or context explaining their purpose. They appear alongside MOCK and MOCK_UNVERIFIED test providers, suggesting they may be development/testing only. Clarify in documentation whether these are intentional production providers or test providers that should be removed.
🤖 Prompt for AI Agents
In `@appwrite/services/account.py` at line 1231, The enum listing OAuth2 providers
includes "githubImagine" and "googleImagine" with no documentation—determine
whether these are production providers or test-only artifacts and either (A) add
a clear doc comment above the enum (or next to the specific values) explaining
their purpose and intended usage (e.g., "test-only/mock providers used for
internal integration testing; not for production"), or (B) remove the
"githubImagine" and "googleImagine" entries from the enum if they are only test
artifacts; if you remove them, also update any tests, fixtures, or reference
code that expect those values (search for "githubImagine" and "googleImagine"
across the repo and update docs/tests accordingly) and ensure the enum docstring
reflects the final set of supported providers.
| Parameters | ||
| ---------- | ||
| organization_id : str | ||
| Team ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring parameter description is inconsistent.
The docstring describes the parameter as "Team ID" but the parameter name is organization_id. This should say "Organization ID" for consistency and clarity.
📝 Suggested fix
Parameters
----------
organization_id : str
- Team ID.
+ Organization ID.🤖 Prompt for AI Agents
In `@appwrite/services/organizations.py` around lines 15 - 18, The docstring for
the parameter organization_id is inconsistent (it says "Team ID"); update the
parameter description in the docstring to read "Organization ID" so it matches
the parameter name organization_id and improves clarity (locate the docstring in
appwrite.services.organizations where organization_id is documented and replace
"Team ID" with "Organization ID").
| Parameters | ||
| ---------- | ||
| organization_id : str | ||
| Team ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring parameter description is inconsistent.
Same issue as the delete method - the docstring describes the parameter as "Team ID" but should say "Organization ID".
📝 Suggested fix
Parameters
----------
organization_id : str
- Team ID.
+ Organization ID.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Parameters | |
| ---------- | |
| organization_id : str | |
| Team ID. | |
| Parameters | |
| ---------- | |
| organization_id : str | |
| Organization ID. |
🤖 Prompt for AI Agents
In `@appwrite/services/organizations.py` around lines 47 - 50, Update the
docstring for the function in appwrite/services/organizations.py that declares
the parameter organization_id so the parameter description reads "Organization
ID" instead of "Team ID"; locate the docstring that documents the
organization_id parameter (same place where delete had the mismatch) and replace
the incorrect "Team ID" text with "Organization ID" to keep docs consistent.
| if name is not None: | ||
| api_params['name'] = name | ||
| api_params['permissions'] = permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's look at the actual code around lines 441-443 in storage.py
cd /root && find . -name "storage.py" -path "*/services/*" | head -5Repository: appwrite/sdk-for-python
Length of output: 122
🏁 Script executed:
# Get the file and check the context around lines 441-443
cat -n appwrite/services/storage.py | sed -n '430,455p'Repository: appwrite/sdk-for-python
Length of output: 1171
🏁 Script executed:
# Check for other instances of permissions handling in update operations across the SDK
rg -n "api_params\['permissions'\]" --type=py appwrite/services/Repository: appwrite/sdk-for-python
Length of output: 1315
🏁 Script executed:
# Look for patterns in databases.py where data is made optional (mentioned in scratchpad)
rg -n "if.*is not None" --type=py appwrite/services/databases.py | head -20Repository: appwrite/sdk-for-python
Length of output: 798
🏁 Script executed:
# Look at the update_file method signature and full context
cat -n appwrite/services/storage.py | sed -n '410,450p'Repository: appwrite/sdk-for-python
Length of output: 1674
🏁 Script executed:
# Check the method signature and parameters
rg -n "def update_file" --type=py appwrite/services/storage.py -A 10Repository: appwrite/sdk-for-python
Length of output: 542
🏁 Script executed:
# Compare with create_file to see if permissions handling differs
rg -n "def create_file" --type=py appwrite/services/storage.py -A 10Repository: appwrite/sdk-for-python
Length of output: 1247
🏁 Script executed:
# Check other create/update methods in storage.py to understand the pattern
rg -n "def (create|update)_" --type=py appwrite/services/storage.py | head -10Repository: appwrite/sdk-for-python
Length of output: 1244
🏁 Script executed:
# Let's see the actual parameter list for update_file
cat -n appwrite/services/storage.py | sed -n '408,445p'Repository: appwrite/sdk-for-python
Length of output: 1532
Apply conditional inclusion to permissions to match documented behavior.
The name parameter is now conditionally included (only when not None), but permissions on line 443 is always included, even when None. The docstring states "By default, the current permissions are inherited," which suggests that when permissions is not provided (None), existing permissions should be preserved. Sending permissions=None may override this behavior.
Apply the same conditional pattern to permissions:
♻️ Suggested fix
if name is not None:
api_params['name'] = name
- api_params['permissions'] = permissions
+ if permissions is not None:
+ api_params['permissions'] = permissions🤖 Prompt for AI Agents
In `@appwrite/services/storage.py` around lines 441 - 443, The permissions value
is always being sent even when None which can override inherited permissions;
change the code that builds api_params to only set api_params['permissions'] =
permissions when permissions is not None (mirroring the existing conditional for
name), i.e., add a conditional check around the permissions assignment so
permissions is only included in api_params when not None.
| policy_id = '<POLICY_ID>', | ||
| name = '<NAME>', # optional | ||
| retention = 1, # optional | ||
| schedule = '', # optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cd /root && find . -name "update-policy.md" -type f 2>/dev/null | head -5Repository: appwrite/sdk-for-python
Length of output: 122
🌐 Web query:
Appwrite backup policy schedule parameter format cron
💡 Result:
Use a standard 5-field cron expression (minute hour day month weekday — e.g. "0 0 * * *" for daily at midnight). Appwrite evaluates cron schedules in UTC. [1][2][3]
Examples:
- Every minute: "*/1 * * * *".
- Hourly: "0 * * * *".
- Daily at 00:00 UTC: "0 0 * * *". [2]
Sources:
- Appwrite Backups (backup policies). [1]
- Appwrite Functions — Schedule / cron examples. [2]
- Appwrite thread confirming cron jobs run in UTC. [3]
🏁 Script executed:
find . -name "update-policy.md" -type f 2>/dev/nullRepository: appwrite/sdk-for-python
Length of output: 107
🏁 Script executed:
git ls-files | grep -i "update-policy.md"Repository: appwrite/sdk-for-python
Length of output: 105
🏁 Script executed:
cat -n docs/examples/backups/update-policy.mdRepository: appwrite/sdk-for-python
Length of output: 695
Use a realistic cron expression for the schedule parameter.
The empty string schedule = '' does not clearly demonstrate the expected format. Appwrite backup schedules require a 5-field cron expression (evaluated in UTC).
Suggested improvement
- schedule = '', # optional
+ schedule = '0 0 * * *', # optional (cron format: daily at midnight UTC)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| schedule = '', # optional | |
| schedule = '0 0 * * *', # optional (cron format: daily at midnight UTC) |
What does this PR do?
Changes as per latest server specs, these include -
Outputis now correctly renamed toImageFormatTest Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit
New Features
Breaking Changes
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.