Skip to content

Conversation

@zealws
Copy link
Contributor

@zealws zealws commented Jul 31, 2025

cool-seq-tool's check_status function fails:

>>> import cool_seq_tool.resources.status
>>> from cool_seq_tool.resources.status import check_status
>>> import asyncio
>>> asyncio.run(check_status())
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    asyncio.run(check_status())
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/zxw016/.pyenv/versions/3.13.5/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/Users/zxw016/.pyenv/versions/3.13.5/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/zxw016/.pyenv/versions/3.13.5/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/Users/zxw016/dev/roya/fusor/.venv/lib/python3.13/site-packages/cool_seq_tool/resources/status.py", line 84, in check_status
    declared_path = file_path_params[name_lower]
                    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'mane_refseq_genomic'

I suspect this was broken when DataFile.MANE_REFSEQ_GENOMIC was added by 546eeab, because that key is not present in the file_path_params dict

The code to pull the DataFile values from the file_path_params checks if the results are None so I think it's safe to use .get(...) instead, rather than using .[...] which fails.

After this change, the code doesn't crash anymore:

>>> import asyncio
>>> from cool_seq_tool.resources.status import check_status
>>> await check_status()
ResourceStatus(uta=True, seqrepo=True, transcript_mappings=True, mane_summary=True, lrg_refseqgene=True, mane_refseq_genomic=True, liftover=True)

@zealws zealws marked this pull request as ready for review July 31, 2025 16:13
@jsstevenson jsstevenson changed the title Fix missing key in file_path_params fix: Fix missing key in file_path_params Jul 31, 2025
@zealws
Copy link
Contributor Author

zealws commented Aug 4, 2025

@korikuzma I applied the change to pass in the `mane_refseq_genomic_path. Let me know if any other changes are required!

@zealws zealws requested a review from korikuzma August 4, 2025 16:28
@korikuzma korikuzma changed the title fix: Fix missing key in file_path_params fix: add mane refseq genomic to check status Aug 4, 2025
Copy link
Member

@korikuzma korikuzma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zealws!

@korikuzma korikuzma merged commit 5b14f4b into GenomicMedLab:main Aug 4, 2025
9 of 10 checks passed
@zealws zealws deleted the fix-missing-key branch August 6, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants