Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🐛 sphinx-needs: a dynamic function returning a link list into an array-of-strings field is refused

Open Beginner friendly
#2,196 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, testing

Research direction

Read _resolve_field and _in_field_type in functions/functions.py to trace how NeedLink values reach the field schema check. Then inspect tests/test_dynamic_functions.py and add the described non-empty link-list case for an array-of-strings field; done means the field accepts and stores the link strings and the focused test passes.

Written by the indexing model from the issue text.

Description

bug pkg: sphinx-needs

What happens

A dynamic function that returns links — links_from_content(), links_from_filter(…), or copy("links", …) — written in a field whose schema is an array of strings is refused with dynamic function value <class 'list'> is not of type 'array' or item type 'string' and the field is left null. An empty result passes (the empty list satisfies the schema), so the refusal only shows once the function finds something.

Found by the ubCode parity review of useblocks/ubcode#4026 (its divergence register carries a 🚧 row "sphinx-needs refuses; to fix upstream"): ubCode stores the ids (["REQ_1", "REQ_2"]) for the same sources.

Expected

The NeedLink items are stored as their link strings (REQ_1, REQ_1.p1 for a part), as the :ndf: role renders them since #2194, so an array-of-strings field can hold a computed link list.

Where

The field join in functions/functions.py (_resolve_field / _in_field_type): a NeedLink reaching a non-link field is not converted before the schema check. One conversion at the join plus a pin in tests/test_dynamic_functions.py (a list of links into tags-like array field, non-empty).

Dominant language
Python
Stars
309
Forks
103
Avg merge
11h 26m
Merged PRs (30d)
118

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from useblocks/sphinx-needs

All issues in useblocks/sphinx-needs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.