🐛 sphinx-needs: a dynamic function returning a link list into an array-of-strings field is refused
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from useblocks/sphinx-needs
-
documentation pkg: sphinx-needs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
useblocks/sphinx-needs#2255 ·
Maintainers usually reply within 1 day
-
bug pkg: sphinx-needs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
useblocks/sphinx-needs#2253 ·
Maintainers usually reply within 1 day
-
bug pkg: sphinx-needs
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
useblocks/sphinx-needs#2251 ·
Maintainers usually reply within 1 day
-
bug pkg: sphinx-needs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
useblocks/sphinx-needs#2249 ·
Maintainers usually reply within 1 day
-
documentation pkg: sphinx-test-reports
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
useblocks/sphinx-needs#2247 ·
Maintainers usually reply within 1 day
All issues in useblocks/sphinx-needs
Similar issues
-
fix formatting of the sample database page of the docsPossibly taken @Aaqibhafeezkhan claimed this today. Opendocumentation good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 72/100
chaoss/CollectOSS#544 · 1 comment ·
Maintainers usually reply within 1 day
-
area/plugin good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kestra-io/plugin-soda#137 ·
-
Difficulty 2/5 Half a day Newbie friendliness 62/100
ibm-granite/granite.build#504 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day