Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#2,196 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, testing

Direzione di ricerca

Leggi _resolve_field e _in_field_type in functions/functions.py per seguire come i valori NeedLink arrivano alla verifica dello schema del campo. Poi esamina tests/test_dynamic_functions.py e aggiungi il caso descritto di una lista di link non vuota per un campo di tipo array di stringhe; il lavoro è concluso quando il campo accetta e memorizza le stringhe dei link e il test mirato passa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
Python
Stelle
309
Fork
103
Merge medio
10h 9m
PR unite (30g)
133

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di useblocks/sphinx-needs

Tutte le issue di useblocks/sphinx-needs

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.