Skip to content

Conversation

@christyjacob4
Copy link
Contributor

@christyjacob4 christyjacob4 commented Mar 10, 2025

What does this PR do?

In Python 3.13, list is now treated strictly as a built-in function, not a generic type hint. Python 3.13 introduces stricter type enforcement, causing conflicts when list[str] is used without from typing import List. Hence we get this error

Traceback (most recent call last):
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/.venv/bin/mcp-server-appwrite", line 4, in <module>
    from mcp_server_appwrite.__main__ import main
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/src/mcp_server_appwrite/__init__.py", line 1, in <module>
    from . import server
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/src/mcp_server_appwrite/server.py", line 11, in <module>
    from appwrite.services.databases import Databases
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/.venv/lib/python3.13/site-packages/appwrite/services/databases.py", line 8, in <module>
    class Databases(Service):
    ...<1196 lines>...
            }, api_params)
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/.venv/lib/python3.13/site-packages/appwrite/services/databases.py", line 108, in Databases
    def list_collections(self, database_id: str, queries: list[str] = None, search: str = None):
                                                          ~~~~^^^^^
TypeError: 'function' object is not subscriptable

Hence we use the List that offers computability from Python 3.5+ to 3.13

Test 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.)

@christyjacob4 christyjacob4 merged commit 5c7f8e2 into main Mar 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants