Skip to content

Remove _create_sparse_df implementation and use public pandas API in ligrec#1119

Merged
selmanozleyen merged 5 commits intoscverse:mainfrom
selmanozleyen:fix/ligrec-create-sparse-df
Feb 20, 2026
Merged

Remove _create_sparse_df implementation and use public pandas API in ligrec#1119
selmanozleyen merged 5 commits intoscverse:mainfrom
selmanozleyen:fix/ligrec-create-sparse-df

Conversation

@selmanozleyen
Copy link
Member

@selmanozleyen selmanozleyen commented Feb 19, 2026

This is an alternative solution to the problem in #1118. This also gets rid of _create_sparse_df which was a workaround pandas code which will probably age bad since it uses private interfaces and is an old copy of pandas code. It also fixes the the pandas 3.0 compat from the integration tests

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.36%. Comparing base (3c11223) to head (44a4f86).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1119      +/-   ##
==========================================
+ Coverage   66.21%   66.36%   +0.14%     
==========================================
  Files          44       44              
  Lines        7163     7132      -31     
  Branches     1217     1212       -5     
==========================================
- Hits         4743     4733      -10     
+ Misses       1943     1923      -20     
+ Partials      477      476       -1     
Files with missing lines Coverage Δ
src/squidpy/gr/_ligrec.py 77.51% <100.00%> (+0.22%) ⬆️
src/squidpy/gr/_utils.py 65.92% <100.00%> (+5.57%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@selmanozleyen
Copy link
Member Author

@Intron7 pinging also you because I saw that you also use a copied version of _create_sparse_df in rsc.

@timtreis
Copy link
Member

Your fix shrinks the codebase which I tend to prefer. Did you verify that this passes tests if you manually force pandas >=3.0

@flying-sheep
Copy link
Member

flying-sheep commented Feb 19, 2026

modified from pandas' source code

was a horrible comment, I’d expect all of the following questions answered in it, and it answers none:

  • why was it modified? specifically:
    • what is it that the original code fails to do?
    • why was it copy-pasted instead of choosing a more robust approach?
  • how was it modified? (which part was added/changed?)
  • where is the original code and which exact commit does the original code come from? (there should be a link to the exact source lines including a commit hash)

@selmanozleyen
Copy link
Member Author

Did you verify that this passes tests if you manually force pandas >=3.0

yes in fact let me add CI which does this

was a horrible comment, I’d expect all of the following questions answered in it, and it answers none:

why was it modified? specifically:
    what is it that the original code fails to do?
    why was it copy-pasted instead of choosing a more robust approach?
how was it modified? (which part was added/changed?)
where is the original code and which exact commit does the original code come from? (there should be a link to the exact source lines including a commit hash)

I think it's just to control fill_values? I think it was infered from dytpe back then?

@selmanozleyen selmanozleyen merged commit 1bba002 into scverse:main Feb 20, 2026
14 checks passed
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