Skip to content

Miscellaneous indexing fixes#380

Merged
daisieh merged 2 commits intodevelopfrom
hotfix/not-experiment
Dec 2, 2025
Merged

Miscellaneous indexing fixes#380
daisieh merged 2 commits intodevelopfrom
hotfix/not-experiment

Conversation

@daisieh
Copy link
Member

@daisieh daisieh commented Dec 2, 2025

If you run a genomic query, part of the query operation tries to look up every drs object ID as if it is an experiment. This is a separate problem that I need to work on for https://candig.atlassian.net/browse/DIG-2136. However, because it is doing all of these erroneous htsget lookups, it is causing a 500 error because I didn't catch the "this object is valid but not an experiment" case correctly. This PR fixes that.

It also makes sure that the indexed flag gets set in the variantfile database; I thought it was but I guess I missed it?

This is currently deployed on UHN-prod and indexing seems to be going fine there now.

@daisieh daisieh requested a review from OrdiNeu December 2, 2025 02:45
Comment on lines +579 to +583
new_variantfile = session.query(VariantFile).filter_by(id=variantfile_id).one_or_none()
if new_variantfile is not None:
new_variantfile.indexed = 1
session.add(new_variantfile)
session.commit()
Copy link
Contributor

Choose a reason for hiding this comment

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

If the new variantfile doesn't exist in the database, should it create a new entry?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so: this is actually the second time we look up a variantfile in this method; the first time is at the top, and that time it returns None:

        if new_variantfile is None:
            logger.debug(f"couldn't find variantfile {variantfile_id}")
            return None # we can't work on nonexistent variantfiles

@daisieh daisieh merged commit c162325 into develop Dec 2, 2025
1 check passed
@daisieh daisieh deleted the hotfix/not-experiment branch December 5, 2025 18:31
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