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

edgedb-py reports a computed field error, when actually it's a duplicate #492

Open
jimkring opened this issue May 17, 2024 · 0 comments
Open

Comments

@jimkring
Copy link

jimkring commented May 17, 2024

Describe the bug
I had a duplicate field in a query:

update PackageVersion
filter .id = <uuid>$id
set {
    pkg := <optional Package><optional uuid>$package_id ?? .pkg,
    display_name := <optional str>$display_name ?? .display_name,
    version_string := <optional str>$version_string ?? .version_string,
    icon := <optional Image><optional uuid>$icon_id ?? .icon,
    display_name := <optional str>$display_name ?? .display_name,
    description := <optional str>$description ?? .description,
};

when I run edgedb-py I get the following error message:

File "edgedb\protocol\protocol.pyx", line 322, in _parse
edgedb.errors.QueryError: modification of computed property 'display_name' of object type 'default::PackageVersion' is prohibited
   ┌─ query:8:5
   │ 
 8 │       display_name := <optional str>$display_name ?? .display_name,
   │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error

Expected behavior
I would hope to have an error indicating that the query is trying to SET the same field twice, the name of the field, and the line that's setting it for the second time.

Versions (please complete the following information):

  • OS: Windows
  • EdgeDB version: 5.2
  • EdgeDB CLI version: 5.1.0+fdf5320
  • edgedb-python version: 1.9.0
  • Python version: 3.11.4

Additional context
Thanks for your great work on edgedb!

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