Skip to content

Commit 9323552

Browse files
TST / string dtype: add env variable to enable future_string and add test build (#58459)
1 parent b71c599 commit 9323552

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/unit-tests.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
env_file: actions-39.yaml
8686
pattern: "not slow and not network and not single_cpu"
8787
pandas_copy_on_write: "warn"
88+
- name: "Future infer strings"
89+
env_file: actions-311.yaml
90+
pattern: "not slow and not network and not single_cpu"
91+
pandas_future_infer_string: "1"
8892
- name: "Pypy"
8993
env_file: actions-pypy-39.yaml
9094
pattern: "not slow and not network and not single_cpu"
@@ -103,7 +107,8 @@ jobs:
103107
LANG: ${{ matrix.lang || 'C.UTF-8' }}
104108
LC_ALL: ${{ matrix.lc_all || '' }}
105109
PANDAS_COPY_ON_WRITE: ${{ matrix.pandas_copy_on_write || '0' }}
106-
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
110+
PANDAS_CI: '1'
111+
PANDAS_FUTURE_INFER_STRING: ${{ matrix.pandas_future_infer_string || '0' }}
107112
TEST_ARGS: ${{ matrix.test_args || '' }}
108113
PYTEST_WORKERS: ${{ matrix.pytest_workers || 'auto' }}
109114
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}

ci/run_tests.sh

+6
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@ if [[ "$PATTERN" ]]; then
1616
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""
1717
fi
1818

19+
# temporarily let pytest always succeed (many tests are not yet passing in the
20+
# build enabling the future string dtype)
21+
if [[ "$PANDAS_FUTURE_INFER_STRING" == "1" ]]; then
22+
PYTEST_CMD="$PYTEST_CMD || true"
23+
fi
24+
1925
echo $PYTEST_CMD
2026
sh -c "$PYTEST_CMD"

pandas/core/config_init.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def register_converter_cb(key) -> None:
905905
with cf.config_prefix("future"):
906906
cf.register_option(
907907
"infer_string",
908-
False,
908+
True if os.environ.get("PANDAS_FUTURE_INFER_STRING", "0") == "1" else False,
909909
"Whether to infer sequence of str objects as pyarrow string "
910910
"dtype, which will be the default in pandas 3.0 "
911911
"(at which point this option will be deprecated).",

0 commit comments

Comments
 (0)