Skip to content

Building pages fails when encountering empty field #102

@caufieldjh

Description

@caufieldjh

The generate-pages action fails when provided a source YAML with an empty field.
This is specifically a bug in browser_export.py.

See https://github.com/monarch-initiative/dismech/actions/runs/20855636245/job/59921394677

Run just gen-browser-data
uv run python -c "from pathlib import Path; from dismech.export import BrowserExporter; BrowserExporter().export_to_js(sorted(Path('kb/disorders').glob('*.yaml')), Path('app/data.js'))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from pathlib import Path; from dismech.export import BrowserExporter; BrowserExporter().export_to_js(sorted(Path('kb/disorders').glob('*.yaml')), Path('app/data.js'))
                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/dismech/dismech/src/dismech/export/browser_export.py", line 151, in export_to_js
    record = self.extract_disorder(disorder, file_path.name)
  File "/home/runner/work/dismech/dismech/src/dismech/export/browser_export.py", line 85, in extract_disorder
    genes = [g.get("name", "") for g in disorder.get("genetic", []) if g.get("name")]
                                        ~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
error: Recipe `gen-browser-data` failed on line 262 with exit code 1

Metadata

Metadata

Labels

bugSomething isn't workinggithub_actionsPull requests that update GitHub Actions code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions