Skip to content

Conversation

@thomas-reimonn
Copy link
Contributor

@thomas-reimonn thomas-reimonn commented Apr 3, 2024

This PR orders the results. By default, it's ordered by chrom, start, and id. Custom ordering can be provided using order_by.

If subsets of columns are selected, then the columns are sorted with available columns and finally by id.

@ivirshup
Copy link
Member

ivirshup commented Apr 4, 2024

I think we could do something like:

        order_cols = []
        if "gene" in tables:
            order_cols += ["seq_name", "gene_seq_start"]
        if "tx" in tables:
            order_cols += ["tx_seq_start"]
        if "exon" in tables:
            order_cols += ["exon_seq_start"]

to have a consistent total order. But idk for sure.

Can this get some tests for expected behavior?

@thomas-reimonn
Copy link
Contributor Author

I updated it like that. It now sorts in a consistent order. I also added assertions to the tests to validate this functionality.

Copy link
Member

@ivirshup ivirshup left a comment

Choose a reason for hiding this comment

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

Could you add tests where we are selecting columns from a different table, e.g. .genes(["seq_name", "gene_...", "exon_id"]) and checking that the results are sorted?

@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.55%. Comparing base (bae82d2) to head (307ad86).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
+ Coverage   92.94%   93.55%   +0.61%     
==========================================
  Files           6        6              
  Lines         340      357      +17     
==========================================
+ Hits          316      334      +18     
+ Misses         24       23       -1     
Files with missing lines Coverage Δ
src/genomic_features/ensembl/ensembldb.py 93.92% <100.00%> (+1.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ivirshup
Copy link
Member

Sorry for the delay on review/ approval but I wanted to dig into the duckdb behaviour we saw a bit more. An ibis maintainer believes this might be a duckdb bug.

@thomas-reimonn thomas-reimonn closed this by deleting the head repository Jun 3, 2025
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.

3 participants