Skip to content

Commit

Permalink
TST / string dtype: add env variable to enable future_string and add …
Browse files Browse the repository at this point in the history
…test build (pandas-dev#58459)
  • Loading branch information
jorisvandenbossche committed Oct 3, 2024
1 parent b1b8eed commit 5778049
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
env_file: actions-39.yaml
pattern: "not slow and not network and not single_cpu"
pandas_copy_on_write: "warn"
- name: "Future infer strings"
env_file: actions-311.yaml
pattern: "not slow and not network and not single_cpu"
pandas_future_infer_string: "1"
- name: "Pypy"
env_file: actions-pypy-39.yaml
pattern: "not slow and not network and not single_cpu"
Expand All @@ -103,7 +107,8 @@ jobs:
LANG: ${{ matrix.lang || 'C.UTF-8' }}
LC_ALL: ${{ matrix.lc_all || '' }}
PANDAS_COPY_ON_WRITE: ${{ matrix.pandas_copy_on_write || '0' }}
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
PANDAS_CI: '1'
PANDAS_FUTURE_INFER_STRING: ${{ matrix.pandas_future_infer_string || '0' }}
TEST_ARGS: ${{ matrix.test_args || '' }}
PYTEST_WORKERS: ${{ matrix.pytest_workers || 'auto' }}
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
Expand Down
6 changes: 6 additions & 0 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ if [[ "$PATTERN" ]]; then
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""
fi

# temporarily let pytest always succeed (many tests are not yet passing in the
# build enabling the future string dtype)
if [[ "$PANDAS_FUTURE_INFER_STRING" == "1" ]]; then
PYTEST_CMD="$PYTEST_CMD || true"
fi

echo $PYTEST_CMD
sh -c "$PYTEST_CMD"
2 changes: 1 addition & 1 deletion pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def register_converter_cb(key) -> None:
with cf.config_prefix("future"):
cf.register_option(
"infer_string",
False,
True if os.environ.get("PANDAS_FUTURE_INFER_STRING", "0") == "1" else False,
"Whether to infer sequence of str objects as pyarrow string "
"dtype, which will be the default in pandas 3.0 "
"(at which point this option will be deprecated).",
Expand Down

0 comments on commit 5778049

Please sign in to comment.