You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Support pandas 3+ in the dataframes API #40709
Beam is hard-capped at pandas 2.3.3 because the dataframes module is not currently compatible with pandas 3+. This will limit support for pandas in Python versions after 3.14 and the upgrade should be scoped out for viability.
Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
I'd be interested in investigating the feasibility of supporting pandas 3+ in Beam's DataFrames API.
I plan to start by identifying the current pandas version constraints, reviewing the DataFrames API for deprecated or incompatible pandas usage, and running the relevant test suites against pandas 3.x to identify concrete compatibility failures. Based on those findings, I can assess the scope of the required changes and outline a backward-compatible implementation approach.
Would this investigation be helpful? I'm happy to share the findings before proceeding with any broader changes.
Following up on the upgrade scoping for Pandas 3.0+, here is the inventory of breaking changes, Beam touchpoints, behavioral decisions, and rollout strategy:
1. Inventory of Pandas 3.0/3.1 Changes & Beam Touchpoints
Python Versioning: Pandas 3.0 drops Python 3.10 (requires 3.11+). When the cap is raised, PEP 508 environment markers (python_version < "3.11" vs >= "3.11") will partition the dependency in setup.py.
String Dtype (future.infer_string=True): Default string columns infer as pd.StringDtype (PyArrow or python-backed) with <NA> instead of object with np.nan.
Touchpoints:apache_beam/typehints/pandas_type_compatibility.py and apache_beam/dataframe/schemas.py.
Decision: Use pd.api.types.is_string_dtype(dtype) to map all string dtypes to Optional[str], while keeping dtype.kind == 'O' mapped to Any.
Copy-on-Write (CoW): Permanently enforced; copy=True deprecated or ignored.
Decision: Guard definitions with hasattr(base_type, '...') to prevent import-time reflection crashes. In Pandas 3.0, users migrate to .map() and .ffill() / .bfill().
Removed Arguments (method in fillna, axis in groupby):
Decision: Add removed_args=['method'] and avoid passing method=None to df.fillna(). Raise clean NotImplementedError for groupby(axis=1) under Pandas 3.0+.
Default Containers & Dependencies:
Touchpoints: Automated weekly dependency bumps update release containers (apache/beam_python3.11_sdk, etc.). Keeping the cap below 3.0 in preparation PRs prevents prematurely shifting worker container runtimes.
2. Rollout Plan
Phase 1 (PR Support pandas 3+ in the dataframes API (#40709) #40768): Land all backward-compatible reflection hardening, hasattr() guards, and dtype conversions while keeping the cap below 3.0 (pandas>=2.2.2,<2.4). Validate with a new py311-pandas-23future tox environment running with PANDAS_MODE__COPY_ON_WRITE=1 and PANDAS_FUTURE__INFER_STRING=1.
Phase 2: Run experimental CI suites against Pandas 3.0 pre-releases to verify edge-case doctest formatting and signature parity.
Phase 3: Raise the cap (pandas<3.2) for Python 3.11+ in a dedicated PR with an entry in CHANGES.md.
Partitioning the dependency based on Python 3.10 is a no-op since Beam Python has already dropped 3.10 support. You have some options based on the approach here, but since this blocks 3.15 support in the Python SDK you're better off not partitioning at all. Post-3.15 support we can make the decision to allow 3.11-3.14 to use pandas 3+ or not.
Separately, phase 2 is not particularly well-planned. Why run against 3.0 pre-releases instead of the full 3.0+ releases we're looking to support? Doing that in CI is also something you'll need a Beam committer to help with, since they'll need to open a branch on the main repo to configure those changes and run modified workflows.
I would also be interested in if there are any new features in pandas 3+ that would be worth surfacing via the dataframes API. This has been largely focused on making everything that already exists within the SDK work, but we should consider benefits to pandas 3+ as well.
Activity
alisha-1000 commentedon Oct 23, 2026
Hi @jrmccluskey,
I'd be interested in investigating the feasibility of supporting pandas 3+ in Beam's DataFrames API.
I plan to start by identifying the current pandas version constraints, reviewing the DataFrames API for deprecated or incompatible pandas usage, and running the relevant test suites against pandas 3.x to identify concrete compatibility failures. Based on those findings, I can assess the scope of the required changes and outline a backward-compatible implementation approach.
Would this investigation be helpful? I'm happy to share the findings before proceeding with any broader changes.
dhanusharer commentedon Oct 24, 2026
.take-issue
dhanusharer commentedon Oct 29, 2026
Pandas 3.0+ Scoping Analysis & Decision Matrix
Following up on the upgrade scoping for Pandas 3.0+, here is the inventory of breaking changes, Beam touchpoints, behavioral decisions, and rollout strategy:
1. Inventory of Pandas 3.0/3.1 Changes & Beam Touchpoints
python_version < "3.11"vs>= "3.11") will partition the dependency insetup.py.future.infer_string=True): Default string columns infer aspd.StringDtype(PyArrow or python-backed) with<NA>instead ofobjectwithnp.nan.apache_beam/typehints/pandas_type_compatibility.pyandapache_beam/dataframe/schemas.py.pd.api.types.is_string_dtype(dtype)to map all string dtypes toOptional[str], while keepingdtype.kind == 'O'mapped toAny.copy=Truedeprecated or ignored.apache_beam/dataframe/frame_base.py(@populate_defaults).copy=Noneunder Pandas 3.0+ to prevent deprecation warnings. Beam DataFrames already operate with immutable stage boundaries.applymap,first,last,GroupBy.fillna):DeferredDataFrame,DeferredSeries,_DeferredGroupByCols.hasattr(base_type, '...')to prevent import-time reflection crashes. In Pandas 3.0, users migrate to.map()and.ffill()/.bfill().methodinfillna,axisingroupby):frames.pydecorators (@args_to_kwargs,@populate_defaults).removed_args=['method']and avoid passingmethod=Nonetodf.fillna(). Raise cleanNotImplementedErrorforgroupby(axis=1)under Pandas 3.0+.apache/beam_python3.11_sdk, etc.). Keeping the cap below 3.0 in preparation PRs prevents prematurely shifting worker container runtimes.2. Rollout Plan
hasattr()guards, and dtype conversions while keeping the cap below 3.0 (pandas>=2.2.2,<2.4). Validate with a newpy311-pandas-23futuretox environment running withPANDAS_MODE__COPY_ON_WRITE=1andPANDAS_FUTURE__INFER_STRING=1.pandas<3.2) for Python 3.11+ in a dedicated PR with an entry inCHANGES.md.jrmccluskey commentedon Nov 3, 2026
Partitioning the dependency based on Python 3.10 is a no-op since Beam Python has already dropped 3.10 support. You have some options based on the approach here, but since this blocks 3.15 support in the Python SDK you're better off not partitioning at all. Post-3.15 support we can make the decision to allow 3.11-3.14 to use pandas 3+ or not.
Separately, phase 2 is not particularly well-planned. Why run against 3.0 pre-releases instead of the full 3.0+ releases we're looking to support? Doing that in CI is also something you'll need a Beam committer to help with, since they'll need to open a branch on the main repo to configure those changes and run modified workflows.
I would also be interested in if there are any new features in pandas 3+ that would be worth surfacing via the dataframes API. This has been largely focused on making everything that already exists within the SDK work, but we should consider benefits to pandas 3+ as well.