kerenduchan / strawberry-demo

3 stars 0 forks source link

When running example query I get a db error #1

Open HenriKorver opened 5 months ago

HenriKorver commented 5 months ago

Hi Keren, your demo project looks very nice, so I want to use it, but unfortunately I run into some problems. Maybe you can help me.

afbeelding

HenriKorver commented 5 months ago

Especially the utils.py file gives a lot of problems following VSC:

[{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportCallIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportCallIssue" } }, "severity": 8, "message": "No overloads for \"select\" match the provided arguments", "source": "Pylance", "startLineNumber": 39, "startColumn": 11, "endLineNumber": 39, "endColumn": 36, "relatedInformation": [ { "startLineNumber": 436, "startColumn": 5, "endLineNumber": 436, "endColumn": 11, "message": "Overload 11 is the closest match", "resource": "/c:/github/strawberry-demo/virtualenv/Lib/site-packages/sqlalchemy/sql/_selectable_constructors.py" } ] },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"T@get\" cannot be assigned to parameter \"entities\" of type \"_ColumnsClauseArgument[Any]\" in function \"select\"\n  Type \"T@get\" cannot be assigned to type \"_ColumnsClauseArgument[Any]\"\n    \"object\" is incompatible with \"TypedColumnsClauseRole[Any]\"\n    \"object\" is incompatible with \"ColumnsClauseRole\"\n    \"object\" is incompatible with \"SQLCoreOperations[Any]\"\n    \"object\" is incompatible with \"Type[Any]\"\n    \"object\" is incompatible with \"Inspectable[_HasClauseElement[Any]]\"\n    \"object\" is incompatible with protocol \"_HasClauseElement[Any]\"\n      \"clause_element\" is not present\n ...", "source": "Pylance", "startLineNumber": 39, "startColumn": 29, "endLineNumber": 39, "endColumn": 35 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportCallIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportCallIssue" } }, "severity": 8, "message": "No overloads for \"execute\" match the provided arguments", "source": "Pylance", "startLineNumber": 43, "startColumn": 17, "endLineNumber": 43, "endColumn": 37, "relatedInformation": [ { "startLineNumber": 416, "startColumn": 15, "endLineNumber": 416, "endColumn": 22, "message": "Overload 3 is the closest match", "resource": "/c:/github/strawberry-demo/virtualenv/Lib/site-packages/sqlalchemy/ext/asyncio/session.py" } ] },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"Unknown | None\" cannot be assigned to parameter \"statement\" of type \"Executable\" in function \"execute\"\n  Type \"Unknown | None\" cannot be assigned to type \"Executable\"\n    \"None\" is incompatible with \"Executable\"", "source": "Pylance", "startLineNumber": 43, "startColumn": 33, "endLineNumber": 43, "endColumn": 36 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportCallIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportCallIssue" } }, "severity": 8, "message": "No overloads for \"select\" match the provided arguments", "source": "Pylance", "startLineNumber": 47, "startColumn": 11, "endLineNumber": 47, "endColumn": 55, "relatedInformation": [ { "startLineNumber": 436, "startColumn": 5, "endLineNumber": 436, "endColumn": 11, "message": "Overload 11 is the closest match", "resource": "/c:/github/strawberry-demo/virtualenv/Lib/site-packages/sqlalchemy/sql/_selectable_constructors.py" } ] },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"list[count]\" cannot be assigned to parameter \"entities\" of type \"_ColumnsClauseArgument[Any]\" in function \"select\"\n  Type \"list[count]\" cannot be assigned to type \"_ColumnsClauseArgument[Any]\"\n    \"list[count]\" is incompatible with \"TypedColumnsClauseRole[Any]\"\n    \"list[count]\" is incompatible with \"ColumnsClauseRole\"\n    \"list[count]\" is incompatible with \"SQLCoreOperations[Any]\"\n    \"list[count]\" is incompatible with \"Type[Any]\"\n    \"list[count]\" is incompatible with \"Inspectable[_HasClauseElement[Any]]\"\n    \"list[count]\" is incompatible with protocol \"_HasClauseElement[Any]\"\n      \"clause_element\" is not present\n ...", "source": "Pylance", "startLineNumber": 47, "startColumn": 29, "endLineNumber": 47, "endColumn": 54 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportCallIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportCallIssue" } }, "severity": 8, "message": "No overloads for \"execute\" match the provided arguments", "source": "Pylance", "startLineNumber": 50, "startColumn": 17, "endLineNumber": 50, "endColumn": 37, "relatedInformation": [ { "startLineNumber": 416, "startColumn": 15, "endLineNumber": 416, "endColumn": 22, "message": "Overload 3 is the closest match", "resource": "/c:/github/strawberry-demo/virtualenv/Lib/site-packages/sqlalchemy/ext/asyncio/session.py" } ] },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"Unknown | None\" cannot be assigned to parameter \"statement\" of type \"Executable\" in function \"execute\"\n  Type \"Unknown | None\" cannot be assigned to type \"Executable\"\n    \"None\" is incompatible with \"Executable\"", "source": "Pylance", "startLineNumber": 50, "startColumn": 33, "endLineNumber": 50, "endColumn": 36 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"T@update\" cannot be assigned to parameter \"table\" of type \"_DMLTableArgument\" in function \"update\"\n  Type \"T@update\" cannot be assigned to type \"_DMLTableArgument\"\n    \"object\" is incompatible with \"TableClause\"\n    \"object\" is incompatible with \"Join\"\n    \"object\" is incompatible with \"Alias\"\n    \"object\" is incompatible with \"CTE\"\n    \"object\" is incompatible with \"Type[Any]\"\n    \"object\" is incompatible with \"Inspectable[_HasClauseElement[Any]]\"\n    \"object\" is incompatible with protocol \"_HasClauseElement[Any]\"\n ...", "source": "Pylance", "startLineNumber": 70, "startColumn": 29, "endLineNumber": 70, "endColumn": 35 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportAttributeAccessIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportAttributeAccessIssue" } }, "severity": 8, "message": "Cannot access member \"id\" for type \"object\"\n  Member \"id\" is unknown", "source": "Pylance", "startLineNumber": 71, "startColumn": 22, "endLineNumber": 71, "endColumn": 24 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportCallIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportCallIssue" } }, "severity": 8, "message": "No overloads for \"select\" match the provided arguments", "source": "Pylance", "startLineNumber": 82, "startColumn": 11, "endLineNumber": 82, "endColumn": 36, "relatedInformation": [ { "startLineNumber": 436, "startColumn": 5, "endLineNumber": 436, "endColumn": 11, "message": "Overload 11 is the closest match", "resource": "/c:/github/strawberry-demo/virtualenv/Lib/site-packages/sqlalchemy/sql/_selectable_constructors.py" } ] },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"T@update\" cannot be assigned to parameter \"entities\" of type \"_ColumnsClauseArgument[Any]\" in function \"select\"\n  Type \"T@update\" cannot be assigned to type \"_ColumnsClauseArgument[Any]\"\n    \"object\" is incompatible with \"TypedColumnsClauseRole[Any]\"\n    \"object\" is incompatible with \"ColumnsClauseRole\"\n    \"object\" is incompatible with \"SQLCoreOperations[Any]\"\n    \"object\" is incompatible with \"Type[Any]\"\n    \"object\" is incompatible with \"Inspectable[_HasClauseElement[Any]]\"\n    \"object\" is incompatible with protocol \"_HasClauseElement[Any]\"\n      \"__clause_element__\" is not present\n ...", "source": "Pylance", "startLineNumber": 82, "startColumn": 29, "endLineNumber": 82, "endColumn": 35 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportAttributeAccessIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportAttributeAccessIssue" } }, "severity": 8, "message": "Cannot access member \"id\" for type \"object\"\n  Member \"id\" is unknown", "source": "Pylance", "startLineNumber": 82, "startColumn": 50, "endLineNumber": 82, "endColumn": 52 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportArgumentType", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportArgumentType" } }, "severity": 8, "message": "Argument of type \"T@delete\" cannot be assigned to parameter \"table\" of type \"_DMLTableArgument\" in function \"delete\"\n  Type \"T@delete\" cannot be assigned to type \"_DMLTableArgument\"\n    \"object\" is incompatible with \"TableClause\"\n    \"object\" is incompatible with \"Join\"\n    \"object\" is incompatible with \"Alias\"\n    \"object\" is incompatible with \"CTE\"\n    \"object\" is incompatible with \"Type[Any]\"\n    \"object\" is incompatible with \"Inspectable[_HasClauseElement[Any]]\"\n    \"object\" is incompatible with protocol \"_HasClauseElement[Any]\"\n ...", "source": "Pylance", "startLineNumber": 92, "startColumn": 29, "endLineNumber": 92, "endColumn": 35 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportAttributeAccessIssue", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportAttributeAccessIssue" } }, "severity": 8, "message": "Cannot access member \"id\" for type \"object*\"\n  Member \"id\" is unknown", "source": "Pylance", "startLineNumber": 93, "startColumn": 22, "endLineNumber": 93, "endColumn": 24 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportInvalidTypeVarUse", "target": { "$mid": 1, "external": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportInvalidTypeVarUse", "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportInvalidTypeVarUse" } }, "severity": 4, "message": "TypeVar \"T\" appears only once in generic function signature\n  Use \"object\" instead", "source": "Pylance", "startLineNumber": 25, "startColumn": 17, "endLineNumber": 25, "endColumn": 18 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportInvalidTypeVarUse", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportInvalidTypeVarUse" } }, "severity": 4, "message": "TypeVar \"T\" appears only once in generic function signature\n  Use \"object\" instead", "source": "Pylance", "startLineNumber": 60, "startColumn": 26, "endLineNumber": 60, "endColumn": 27 },{ "resource": "/c:/github/strawberry-demo/db/utils.py", "owner": "_generated_diagnostic_collectionname#2", "code": { "value": "reportInvalidTypeVarUse", "target": { "$mid": 1, "path": "/microsoft/pyright/blob/main/docs/configuration.md", "scheme": "https", "authority": "github.com", "fragment": "reportInvalidTypeVarUse" } }, "severity": 4, "message": "TypeVar \"T\" appears only once in generic function signature\n  Use \"object\" instead", "source": "Pylance", "startLineNumber": 91, "startColumn": 49, "endLineNumber": 91, "endColumn": 50 }]

HenriKorver commented 5 months ago

There are also some problems with the session.py file:

afbeelding