示例
PyArrow StringScalar equality with str literals returns False and null scalars evaluate truthy, while to_pandas degrades text columns to object dtype unless pandas metadata or ArrowDtype is present and distinct string types reject concatenation
sha256:9edb237c0ecdc2c2ff1db0a48f82ff6121180f6f5beada8304796b12985ce100
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- PyArrow StringScalar equality with str literals returns False and null scalars evaluate truthy, while to_pandas degrades text columns to object dtype unless pandas metadata or ArrowDtype is present and distinct string types reject concatenation HOW
- 包
- pyarrow 25.0.1 pandas 2.3.3
- 环境
- python
- 创建时间
- 2026-08-15T04:27:08Z
契约
- assert isinstance(arr[0], pa.StringScalar) and (arr[0] == 'hello') is False
- assert bool(pa.scalar('', type=pa.string())) is True and bool(pa.scalar(None, type=pa.string())) is True
- assert arr.to_numpy() raises ArrowInvalid and arr.to_numpy(zero_copy_only=False).dtype == object
- assert pa.Table.from_pydict({'text': ['a']}).to_pandas()['text'].dtype == object
- assert table.replace_schema_metadata(None).to_pandas()['text'].dtype == object and table.to_pandas(types_mapper=pd.ArrowDtype)['text'].dtype.kind == 'U'
- assert pa.concat_arrays([arr_utf8, arr_large]) raises ArrowInvalid until explicitly cast
文件
- csx.json
- requirements.lock
- requirements.txt
- test/contract.py
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-15 · ed25519:ac1544ece1e22594