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

select keyerror #219

Closed
sirex opened this issue Apr 12, 2022 · 0 comments · Fixed by #221
Closed

select keyerror #219

sirex opened this issue Apr 12, 2022 · 0 comments · Fixed by #221
Assignees

Comments

@sirex
Copy link
Collaborator

sirex commented Apr 12, 2022

https://get.data.gov.lt/datasets/gov/lst/standards/StandardICS?select(_id,ics.notation)

Traceback (most recent call last):
  File "spinta/api.py", line 91, in homepage
    return await create_http_response(context, params, request)
  File "spinta/utils/response.py", line 165, in create_http_response
    return await commands.getall(
        context,
        model,
        request,
        action=action,
        params=params,
    )
  File "spinta/commands/read.py", line 95, in getall
    return render(context, request, model, params, rows, action=action)
  File "spinta/renderer.py", line 22, in render
    return commands.render(
  File "spinta/formats/html/commands.py", line 129, in render
    return _render_model(context, request, model, action, params, data, headers)
  File "spinta/formats/html/commands.py", line 233, in _render_model
    ctx = _build_template_context(
  File "spinta/formats/html/commands.py", line 207, in _build_template_context
    rows, empty = _is_empty(rows)
  File "spinta/formats/html/commands.py", line 161, in _is_empty
    row = next(rows)
  File "spinta/utils/nestedstruct.py", line 15, in flatten
    for v in vals:
  File "spinta/commands/read.py", line 84, in <genexpr>
    rows = (
        commands.prepare_data_for_response(
            context,
            model,
            params.fmt,
            row,
            action=action,
            select=select_tree,
            prop_names=prop_names,
        )
        for row in rows
     )
  File "spinta/formats/html/commands.py", line 295, in prepare_data_for_response
    data = {
        ...
        for prop, val, sel in select_model_props(
            model,
            prop_names,
            value,
            select,
            reserved,
        )
    }
  File "spinta/formats/html/commands.py", line 296, in <dictcomp>
    prop.name: commands.prepare_dtype_for_response(
        context,
        fmt,
        prop.dtype,
        val,
        data=value,
        action=action,
        select=sel,
    )
  File "spinta/formats/html/commands.py", line 393, in prepare_dtype_for_response
    if value['_id'] is None:
KeyError: '_id'
@sirex sirex self-assigned this Apr 12, 2022
sirex added a commit that referenced this issue Apr 15, 2022
Repository owner moved this from In Progress to Done in Portalo plėtra Apr 15, 2022
@sirex sirex added this to Palaikymas Nov 16, 2022
@sirex sirex removed this from Portalo plėtra Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant