Skip to content

Commit ebc60f2

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

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/unit-tests.yml

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ jobs:
5757
# Also install zh_CN (its encoding is gb2312) but do not activate it.
5858
# It will be temporarily activated during tests with locale.setlocale
5959
extra_loc: "zh_CN"
60+
- name: "Future infer strings"
61+
env_file: actions-311.yaml
62+
pattern: "not slow and not network and not single_cpu"
63+
pandas_future_infer_string: "1"
6064
- name: "Pypy"
6165
env_file: actions-pypy-39.yaml
6266
pattern: "not slow and not network and not single_cpu"
@@ -75,6 +79,7 @@ jobs:
7579
LANG: ${{ matrix.lang || 'C.UTF-8' }}
7680
LC_ALL: ${{ matrix.lc_all || '' }}
7781
PANDAS_CI: '1'
82+
PANDAS_FUTURE_INFER_STRING: ${{ matrix.pandas_future_infer_string || '0' }}
7883
TEST_ARGS: ${{ matrix.test_args || '' }}
7984
PYTEST_WORKERS: 'auto'
8085
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
@@ -858,7 +858,7 @@ def register_converter_cb(key: str) -> None:
858858
with cf.config_prefix("future"):
859859
cf.register_option(
860860
"infer_string",
861-
False,
861+
True if os.environ.get("PANDAS_FUTURE_INFER_STRING", "0") == "1" else False,
862862
"Whether to infer sequence of str objects as pyarrow string "
863863
"dtype, which will be the default in pandas 3.0 "
864864
"(at which point this option will be deprecated).",

0 commit comments

Comments
 (0)