-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort output #64
base: main
Are you sure you want to change the base?
Sort output #64
Conversation
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? |
I updated it like that. It now sorts in a consistent order. I also added assertions to the tests to validate this functionality. |
There was a problem hiding this 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
==========================================
- Coverage 93.09% 93.01% -0.08%
==========================================
Files 6 6
Lines 333 358 +25
==========================================
+ Hits 310 333 +23
- Misses 23 25 +2
|
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. |
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
.