geldata / geldata/gel-python

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

Open
#492 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
415
Forks
50
PR merge metrics
No merged PRs in 30d

Description

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

```
update PackageVersion
filter .id = $id
set {
pkg := $package_id ?? .pkg,
display_name := $display_name ?? .display_name,
version_string := $version_string ?? .version_string,
icon := $icon_id ?? .icon,
display_name := $display_name ?? .display_name,
description := $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 := $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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.