Skip to content

Commit dc685a7

Browse files
committed
# (C) 2026 GoodData Corporation
fix(docs): generate pages for all duplicate-named modules python_ref_builder used leaf name as the links dict key with an "if name not in links" guard that skipped page creation for modules sharing a name (e.g. declarative_model exists under data_source, workspace, user, and permission). Only the first was generated. Decouple page creation from the links dedup check so all modules get their directories and pages, while the links dict still uses first-wins for type-annotation resolution. JIRA: trivial risk: nonprod
1 parent bf609e4 commit dc685a7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

scripts/docs/python_ref_builder.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -333,34 +333,34 @@ def _pass1(data_root: dict, dir_root: Path, api_ref_root: str, module_import_pat
333333
obj_module_import_path = obj_module_import_path.replace(".functions", "")
334334

335335
if kind == "module":
336+
(dir_root / name).mkdir(exist_ok=True)
336337
if name not in links:
337-
(dir_root / name).mkdir(exist_ok=True)
338338
links[name] = {"path": f"{api_ref_root}/{name}".lower(), "kind": "function"}
339-
pages.append(
340-
_PageSpec(
341-
kind="module",
342-
name=name,
343-
parent_name="",
344-
import_path=obj_module_import_path,
345-
file_path=dir_root / name / "_index.md",
346-
data=obj,
347-
)
339+
pages.append(
340+
_PageSpec(
341+
kind="module",
342+
name=name,
343+
parent_name="",
344+
import_path=obj_module_import_path,
345+
file_path=dir_root / name / "_index.md",
346+
data=obj,
348347
)
348+
)
349349

350350
elif kind == "class":
351+
(dir_root / name).mkdir(exist_ok=True)
351352
if name not in links:
352-
(dir_root / name).mkdir(exist_ok=True)
353353
links[name] = {"path": f"{api_ref_root}/{name}".lower(), "kind": "class"}
354-
pages.append(
355-
_PageSpec(
356-
kind="class",
357-
name=name,
358-
parent_name=module_import_path.split(".")[-1],
359-
import_path=obj_module_import_path,
360-
file_path=dir_root / name / "_index.md",
361-
data=obj,
362-
)
354+
pages.append(
355+
_PageSpec(
356+
kind="class",
357+
name=name,
358+
parent_name=module_import_path.split(".")[-1],
359+
import_path=obj_module_import_path,
360+
file_path=dir_root / name / "_index.md",
361+
data=obj,
363362
)
363+
)
364364

365365
elif name == "functions":
366366
for func_name in obj:

0 commit comments

Comments
 (0)