You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "rok (via GitHub)" <gi...@apache.org> on 2026/01/30 15:45:59 UTC

[PR] [MINOR] Fix doctests failing on pandas 3 string types examples [arrow]

rok opened a new pull request, #49088:
URL: https://github.com/apache/arrow/pull/49088

   See https://github.com/apache/arrow/pull/48619#issuecomment-3823269381
   
   ### Rationale for this change
   
   Fix CI failures
   
   ### What changes are included in this PR?
   
   Tests are made more general to allow for Pandas 2 and Pandas 3 style string types
   
   ### Are these changes tested?
   
   By CI
   
   ### Are there any user-facing changes?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2747150383


##########
docs/source/python/data.rst:
##########
@@ -684,7 +684,7 @@ When using :class:`~.DictionaryArray` with pandas, the analogue is
    6    NaN
    7    baz
    dtype: category
-   Categories (3, object): ['foo', 'bar', 'baz']
+   Categories (3, ...): ['foo', 'bar', 'baz']

Review Comment:
   FWIW, I think if we know the doctests will run on an instance with pandas>=3, I would just update those to use pandas 3 output, because that will be less confusing for people reading the docs ("what do those 3 dots mean here?").
   
   
   ```suggestion
      Categories (3, str): ['foo', 'bar', 'baz']
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-49150: [Doc][CI][Python] Doctests failing on doctests in rst files due to pandas 3+ [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #49088:
URL: https://github.com/apache/arrow/pull/49088#issuecomment-3849275760

   :warning: GitHub issue #49150 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-49150: [Doc][CI][Python] Doctests failing on doctests in rst files due to pandas 3+ [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2765606134


##########
docs/source/python/memory.rst:
##########
@@ -102,7 +102,7 @@ Let's allocate a resizable :class:`Buffer` from the default pool:
 
    >>> buf = pa.allocate_buffer(1024, resizable=True)
    >>> pa.total_allocated_bytes()
-   1024
+   2496

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2749798533


##########
docs/source/python/data.rst:
##########
@@ -684,7 +684,7 @@ When using :class:`~.DictionaryArray` with pandas, the analogue is
    6    NaN
    7    baz
    dtype: category
-   Categories (3, object): ['foo', 'bar', 'baz']
+   Categories (3, ...): ['foo', 'bar', 'baz']

Review Comment:
   If we do agree to stop doctest on Pandas 2.x.y then we should also update CI appropriately.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "tadeja (via GitHub)" <gi...@apache.org>.
tadeja commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2765143153


##########
docs/source/python/memory.rst:
##########
@@ -102,7 +102,7 @@ Let's allocate a resizable :class:`Buffer` from the default pool:
 
    >>> buf = pa.allocate_buffer(1024, resizable=True)
    >>> pa.total_allocated_bytes()
-   1024
+   2496

Review Comment:
   Revert this change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+ [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on PR #49088:
URL: https://github.com/apache/arrow/pull/49088#issuecomment-3849603381

   > "Docs / AMD64 Debian 12 Complete Documentation" seems to be failing for CRAN reasons:
   > 
   > ```r
   > -- Building articles -----------------------------------------------------------
   > Warning message:
   > @examplesIf condition "arrow_with_dataset() &&
   > identical(Sys.getenv(\"NOT_CRAN\"), \"true\")" is "FALSE"
   > ---
   > Backtrace:
   > 1. pkgdown::build_site(install = FALSE)
   > 2. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_d...
   > 3. callr::r(function(..., cli_colors, hyperlinks) { ...
   > 4. callr:::get_result(output = out, options)
   > 5. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
   > ---
   > Subprocess backtrace:
   >  1. pkgdown::build_site(...)
   >  2. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont...
   >  3. pkgdown::build_articles(pkg, lazy = lazy, override = override, quiet = quiet, ...
   >  4. pkgdown::build_articles_index(pkg)
   >  5. pkgdown::render_page(pkg, "article-index", data = data_articles_index(pkg), ...
   >  6. pkgdown:::render_page_html(pkg, name = name, data = data, depth = depth)
   >  7. pkgdown:::modify_list(data_template(pkg, depth = depth), data)
   >  8. pkgdown:::data_articles_index(pkg)
   >  9. pkgdown:::config_abort(pkg, "{length(missing)} vignette{?s} missing from index: {....
   > 10. cli::cli_abort(message, ..., call = call, .envir = .envir)
   > 11. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, ...
   > 12. | rlang:::signal_abort(cnd, .file)
   > 13. | base::signalCondition(cnd)
   > 14. global (function (e) ...
   > Execution halted
   > 
   > Error: `docker compose --file=/home/runner/work/arrow/arrow/compose.yaml run --rm debian-docs` exited with a non-zero exit code 1, see the process 
   > ```
   > 
   > cc @thisisnic
   
   I just merged a fix, if you rebase it should be good for the R docs now :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2749265766


##########
docs/source/python/data.rst:
##########
@@ -648,7 +648,7 @@ Here we have:
 .. code-block:: python
 
    >>> print(dict_array.type)
-   dictionary<values=string, indices=int64, ordered=0>
+   dictionary<values=...string, indices=int64, ordered=0>

Review Comment:
   Indeed, reverted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+ [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on PR #49088:
URL: https://github.com/apache/arrow/pull/49088#issuecomment-3849436988

   "Docs / AMD64 Debian 12 Complete Documentation" seems to be failing for CRAN reasons:
   ```r
   -- Building articles -----------------------------------------------------------
   Warning message:
   @examplesIf condition "arrow_with_dataset() &&
   identical(Sys.getenv(\"NOT_CRAN\"), \"true\")" is "FALSE"
   ---
   Backtrace:
   1. pkgdown::build_site(install = FALSE)
   2. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_d...
   3. callr::r(function(..., cli_colors, hyperlinks) { ...
   4. callr:::get_result(output = out, options)
   5. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
   ---
   Subprocess backtrace:
    1. pkgdown::build_site(...)
    2. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont...
    3. pkgdown::build_articles(pkg, lazy = lazy, override = override, quiet = quiet, ...
    4. pkgdown::build_articles_index(pkg)
    5. pkgdown::render_page(pkg, "article-index", data = data_articles_index(pkg), ...
    6. pkgdown:::render_page_html(pkg, name = name, data = data, depth = depth)
    7. pkgdown:::modify_list(data_template(pkg, depth = depth), data)
    8. pkgdown:::data_articles_index(pkg)
    9. pkgdown:::config_abort(pkg, "{length(missing)} vignette{?s} missing from index: {....
   10. cli::cli_abort(message, ..., call = call, .envir = .envir)
   11. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, ...
   12. | rlang:::signal_abort(cnd, .file)
   13. | base::signalCondition(cnd)
   14. global (function (e) ...
   Execution halted
   
   Error: `docker compose --file=/home/runner/work/arrow/arrow/compose.yaml run --rm debian-docs` exited with a non-zero exit code 1, see the process 
   ```
   
   cc @thisisnic 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on PR #49088:
URL: https://github.com/apache/arrow/pull/49088#issuecomment-3828927199

   Thanks for the review @jorisvandenbossche ! Could you take another look before the merge?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+ [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on PR #49088:
URL: https://github.com/apache/arrow/pull/49088#issuecomment-3850344964

   Thanks @thisisnic, rebasing seems to fix the CI! Merging.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2747150383


##########
docs/source/python/data.rst:
##########
@@ -684,7 +684,7 @@ When using :class:`~.DictionaryArray` with pandas, the analogue is
    6    NaN
    7    baz
    dtype: category
-   Categories (3, object): ['foo', 'bar', 'baz']
+   Categories (3, ...): ['foo', 'bar', 'baz']

Review Comment:
   FWIW, I think if we know the doctests will run on an instance with pandas>=3, I would just update those to use pandas 3 output, because that will be less confusing for people reading the docs.
   
   
   ```suggestion
      Categories (3, str): ['foo', 'bar', 'baz']
   ```



##########
docs/source/python/data.rst:
##########
@@ -648,7 +648,7 @@ Here we have:
 .. code-block:: python
 
    >>> print(dict_array.type)
-   dictionary<values=string, indices=int64, ordered=0>
+   dictionary<values=...string, indices=int64, ordered=0>

Review Comment:
   This one should not be needed? (the dictionary here is created just through pyarrow, no pandas involved?)



##########
docs/source/python/ipc.rst:
##########
@@ -94,7 +94,7 @@ convenience function ``pyarrow.ipc.open_stream``:
    ...     batches = [b for b in reader]
    >>> schema
    f0: int64
-   f1: string
+   f1: ...string

Review Comment:
   Also here, is this actually needed? The example here is pure pyarrow, and that should always be using pyarrow's default of "string" ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2749262651


##########
docs/source/python/data.rst:
##########
@@ -684,7 +684,7 @@ When using :class:`~.DictionaryArray` with pandas, the analogue is
    6    NaN
    7    baz
    dtype: category
-   Categories (3, object): ['foo', 'bar', 'baz']
+   Categories (3, ...): ['foo', 'bar', 'baz']

Review Comment:
   Do we want to start testing on Pandas 3 exclusively? I believe we have both testing now. (One is not triggered for this PR because the scope is smaller)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+ [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok merged PR #49088:
URL: https://github.com/apache/arrow/pull/49088


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2765441981


##########
docs/source/python/data.rst:
##########
@@ -684,7 +684,7 @@ When using :class:`~.DictionaryArray` with pandas, the analogue is
    6    NaN
    7    baz
    dtype: category
-   Categories (3, object): ['foo', 'bar', 'baz']
+   Categories (3, ...): ['foo', 'bar', 'baz']

Review Comment:
   I like this approach. I've reverted changes so that this now tests expected pandas 3 behavior.
   Additionally this also updates Python to 3.11 which then makes `pandas-latest==3+`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2749993332


##########
docs/source/python/data.rst:
##########
@@ -684,7 +684,7 @@ When using :class:`~.DictionaryArray` with pandas, the analogue is
    6    NaN
    7    baz
    dtype: category
-   Categories (3, object): ['foo', 'bar', 'baz']
+   Categories (3, ...): ['foo', 'bar', 'baz']

Review Comment:
   For general tests (unit tests) we certainly have to test with various pandas versions (i.e. whichever range we claim to support), but personally I think for _doctests_ it is perfectly fine to just have those passing in one specific environment (they are not meant as actual proper tests, but only to ensure the docs are correct and kept up to date)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [MINOR] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #49088:
URL: https://github.com/apache/arrow/pull/49088#issuecomment-3824394699

   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   Thanks for opening a pull request!
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
   
   Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
   
   Then could you also rename the pull request title in the following format?
   
       GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   See also:
   
     * [Other pull requests](https://github.com/apache/arrow/pulls/)
     * [Contribution Guidelines - Contributing Overview](https://arrow.apache.org/docs/developers/overview.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on code in PR #49088:
URL: https://github.com/apache/arrow/pull/49088#discussion_r2749264600


##########
docs/source/python/ipc.rst:
##########
@@ -94,7 +94,7 @@ convenience function ``pyarrow.ipc.open_stream``:
    ...     batches = [b for b in reader]
    >>> schema
    f0: int64
-   f1: string
+   f1: ...string

Review Comment:
   Indeed, reverting.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org