edgedb-python icon indicating copy to clipboard operation
edgedb-python copied to clipboard

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

Open jimkring opened this issue 1 year ago • 0 comments

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!

jimkring avatar May 17 '24 16:05 jimkring