Drop deprecated copy keyword from astype call in from_fcs - #184
Open
xyf5432 wants to merge 1 commit into
Open
Conversation
Collaborator
|
Hi @xyf5432, Thank you for the issue and PR! This overall looks great, there is just two things we should do:
Let me know if you need help with that! |
Pandas 4 removes the deprecated `copy` keyword of DataFrame.astype. `copy=False` was inert here — it can only skip an allocation when the frame is already float64 — so the plain cast behaves identically on pandas 2 and 3. Changelog entry moved to a new 1.4.6 (future) section. Co-Authored-By: Claude <noreply@anthropic.com>
xyf5432
force-pushed
the
fix/pandas3-astype-copy-deprecation
branch
from
August 25, 2026 01:05
5a3c368 to
bf9d7c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Guard deprecated astype copy keyword by pandas version in from_fcs
Fixes #183
Changes
Guard the deprecated
copykeyword ofDataFrame.astypeby pandasversion in
from_fcs, so behaviour is preserved on every supportedversion:
src/palantir/io.py: module-levelPANDAS_VERSION = Version(pd.__version__)(from
packaging, already a transitive dependency of pandas), and— the same pattern as Fix pandas 3 string dtype compatibility and CI flakes NVIDIA/cuml#8142.
README.md: changelog entry under Version 1.4.5, alongside thepandas 3 fixes from Pandas 3 compatibility:
ValueError: assignment destination is read-onlyin_differentiation_entropy#180.Verification
The
copykeyword never affects the result ofastypeon anypandas version, only whether an extra copy is made; the branch keeps
that behaviour exactly as it was on each side of the boundary. Runtime
checks on pandas 2.3.3 and 3.0.5, simulating the
from_fcsdata flow(
fcsparser.parse-like DataFrame →astype→ metadata-channel filter →np.arcsinh(np.divide(...))):copy=Falsebranch: already-float64columnsstill share the buffer (
np.shares_memory= True), exactly as beforethe change;
int64→float64columns allocate a new array eitherway (a dtype change cannot be done in place).
Pandas4Warningis emitted,final
arcsinhresults bit-identical to pandas 2.3.3.python -m py_compile.