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

Error on join with base #437

Closed
Tracked by #655
sirex opened this issue Apr 26, 2023 · 0 comments · Fixed by #447
Closed
Tracked by #655

Error on join with base #437

sirex opened this issue Apr 26, 2023 · 0 comments · Fixed by #447
Labels
bug Something isn't working dim:base U5

Comments

@sirex
Copy link
Collaborator

sirex commented Apr 26, 2023

d | r | b | m | property | type    | ref     | access
$DATASET                 |         |         |
  |   |   | Place        |         | id      |
  |   |   |   | id       | integer |         | open
  |   |   |   | name     | string  |         | open
  |   |   |   |          |         |         |
  |   | Place            |         | name    |
  |   |   |   |          |         |         |
  |   |   | Country      |         | id      |
  |   |   |   | id       | integer |         | open
  |   |   |   | name     |         |         | open
  |   |   |   |          |         |         |
  |   |   | City         |         | id      |
  |   |   |   | id       | integer |         | open
  |   |   |   | name     |         |         | open
  |   |   |   | country  | ref     | Country | open
LTU=d55e65c6-97c9-4cd3-99ff-ae34e268289b
VLN=2074d66e-0dfd-4233-b1ec-199abc994d0c

http POST "$SERVER/$DATASET/Place"   $AUTH _id=$LTU id:=1   name=Lithuania
http POST "$SERVER/$DATASET/Country" $AUTH _id=$LTU id:=10

http POST "$SERVER/$DATASET/Place"   $AUTH _id=$VLN id:=2   name=Vilnius
http POST "$SERVER/$DATASET/City"    $AUTH _id=$VLN id:=20  country[_id]=$LTU

http GET  "$SERVER/$DATASET/City?select(id,name,country.name)&format(ascii)"
HTTP/1.1 500 Internal Server Error
{
    "errors": [
        {
            "code": "KeyError",
            "message": "'name'"
        }
    ]
}
tail $BASEDIR/spinta.log
Traceback (most recent call last):
  File "spinta/api.py", line 94, in homepage
    return await create_http_response(context, params, request)
  File "spinta/utils/response.py", line 153, in create_http_response
    return await commands.getall(
  File "spinta/commands/read.py", line 121, in getall
    return render(context, request, model, params, rows, action=action)
  File "spinta/renderer.py", line 23, in render
    return commands.render(
  File "spinta/formats/ascii/commands.py", line 28, in render
    return _render(
  File "spinta/formats/ascii/commands.py", line 62, in _render
    aiter(peek_and_stream(fmt(
  File "spinta/utils/response.py", line 223, in peek_and_stream
    peek = list(itertools.islice(stream, 2))
  File "spinta/formats/ascii/components.py", line 41, in __call__
    peek = next(data, None)
  File "spinta/commands/read.py", line 106, in <genexpr>
    rows = (
  File "spinta/backends/postgresql/commands/read.py", line 51, in getall
    expr = env.resolve(query)
  File "spinta/backends/postgresql/commands/query.py", line 267, in select
    selected = env.call('select', arg)
  File "spinta/backends/postgresql/commands/query.py", line 385, in select
    column = table.c[fpr.right.place]
  File "sqlalchemy/sql/base.py", line 1192, in __getitem__
    return self._index[key]
KeyError: 'name'

Related

@sirex sirex added bug Something isn't working dim:base labels Apr 26, 2023
@adp-atea adp-atea moved this to In Progress in Portalo plėtra May 10, 2023
@adp-atea adp-atea linked a pull request May 12, 2023 that will close this issue
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra May 18, 2023
@sirex sirex moved this from Review to Todo in Portalo plėtra May 25, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra May 29, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Jun 1, 2023
@sirex sirex moved this from Review to Todo in Portalo plėtra Jun 8, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Jun 22, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Jun 27, 2023
@sirex sirex moved this from Review to Todo in Portalo plėtra Aug 4, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Jan 17, 2024
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Jan 18, 2024
@sirex sirex moved this from Review to Deploy in Portalo plėtra Jan 22, 2024
@github-project-automation github-project-automation bot moved this from Deploy to Done in Portalo plėtra Jan 22, 2024
@adp-atea adp-atea moved this from Done to Deploy in Portalo plėtra Jan 22, 2024
@sirex sirex moved this from Deploy to Test in Portalo plėtra Feb 29, 2024
@ATEAanalyst ATEAanalyst added the U5 label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dim:base U5
Projects
Status: Test
Development

Successfully merging a pull request may close this issue.

2 participants