Skip to content
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

Unexpected interface error for query_single[_json] #543

Open
spacemanspiff2007 opened this issue Nov 18, 2024 · 0 comments
Open

Unexpected interface error for query_single[_json] #543

spacemanspiff2007 opened this issue Nov 18, 2024 · 0 comments

Comments

@spacemanspiff2007
Copy link

Describe the bug

Query single methods raise unexpected error without executing the query

Reproduction
Use _example project

    await db.query_single_json(
        'select Movie {**} filter .release_year = <int32>$release_year',
        release_year=32
    )

raises

InterfaceError('query cannot be executed with query_single_json() as it may return more than one element')

Expected behavior
I would expect the behavior that is described in the docs:
The query must return no more than one element. If the query returns more than one element, an edgedb.ResultCardinalityMismatchError is raised, if it returns an empty set, "null" is returned

So the expected behavior is no exception except when multiples entries are returned

  • OS:
  • EdgeDB version: 5.6+b7b0563
  • EdgeDB CLI version: EdgeDB CLI 5.5.2+1743aac
  • edgedb-python version: 2.2.0
  • Python version: 3.12
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

No branches or pull requests

1 participant