You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "AnkitAhlawat7742 (via GitHub)" <gi...@apache.org> on 2026/05/07 05:42:02 UTC

[PR] GH-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   ### Fix:#49933
   ### Rationale for this change
   
   The nightly CI jobs for pandas failing with AssertionError: (None, <Day>) in test_table_column_subset_metadata. 
   
   The test was incorrectly setting `df.index.freq = None` instead of `expected.index.freq = None `since `expected = df[["a"]] `creates an independent Index object. 
   
   ### What changes are included in this PR?
   In file `python/pyarrow/tests/test_pandas.py` we have modified the `test_table_column_subset_metadata` test case.
   
   ### Are these changes tested?
   Yes, Verified locally with pandas nightly (3.1.0.dev0)
   before the code changes 
   
   ```
   pytest /arrow/python/pyarrow/tests/test_pandas.py::TestConvertMetadata::test_table_column_subset_metadata -v
   ================================================================================================ test session starts =================================================================================================
   platform darwin -- Python 3.12.13, pytest-9.0.3, pluggy-1.6.0 -- /opt/homebrew/Caskroom/miniforge/base/envs/arrow-dev/bin/python3.12
   cachedir: .pytest_cache
   hypothesis profile 'dev' -> max_examples=50
   rootdir: /arrow/python
   configfile: setup.cfg
   plugins: xdist-3.8.0, hypothesis-6.152.4
   collected 1 item
   
   arrow/python/pyarrow/tests/test_pandas.py::TestConvertMetadata::test_table_column_subset_metadata FAILED                                                          [100%]
   
   ====================================================================================================== **FAILURES** ======================================================================================================
   _______________________________________________________________________________ TestConvertMetadata.test_table_column_subset_metadata ________________________________________________________________________________
   
   self = <pyarrow.tests.test_pandas.TestConvertMetadata object at 0x116ef5fd0>
   
       def test_table_column_subset_metadata(self):
           # ARROW-1883
           # non-default index
           for index in [
                   pd.Index(['a', 'b', 'c'], name='index'),
                   pd.date_range("2017-01-01", periods=3, tz='Europe/Brussels')]:
               df = pd.DataFrame({'a': [1, 2, 3],
                                  'b': [.1, .2, .3]}, index=index)
               table = pa.Table.from_pandas(df)
   
               table_subset = table.remove_column(1)
               result = table_subset.to_pandas()
               expected = df[['a']]
               if isinstance(df.index, pd.DatetimeIndex):
                   df.index.freq = None
   >           tm.assert_frame_equal(result, expected)
   E           AssertionError: (None, <Day>)
   
   arrow/python/pyarrow/tests/test_pandas.py:643: AssertionError
   ============================================================================================== short test summary info ===============================================================================================
   FAILED Desktop/AnkitAhlawat/opensource_contribution/arrow/python/pyarrow/tests/test_pandas.py::TestConvertMetadata::test_table_column_subset_metadata - AssertionError: (None, <Day>)
   ================================================================================================= **1 failed in 0.32s** ========================================================================
   
   ```
   After the code changes 
   
   ```
   pytest arrow/python/pyarrow/tests/test_pandas.py::TestConvertMetadata::test_table_column_subset_metadata -v
   ================================================================================================ test session starts =================================================================================================
   platform darwin -- Python 3.12.13, pytest-9.0.3, pluggy-1.6.0 -- /opt/homebrew/Caskroom/miniforge/base/envs/arrow-dev/bin/python3.12
   cachedir: .pytest_cache
   hypothesis profile 'dev' -> max_examples=50
   rootdir: /arrow/python
   configfile: setup.cfg
   plugins: xdist-3.8.0, hypothesis-6.152.4
   collected 1 item
   
   arrow/python/pyarrow/tests/test_pandas.py::TestConvertMetadata::test_table_column_subset_metadata PASSED                                                          [100%]
   
   ================================================================================================= 1 passed in 0.23s ==================================================================================================
   ```
   ### Are there any user-facing changes?
   
   No — this is a test-only fix with no impact on public APIs or user-facing behavior.


-- 
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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 35667adc8ab4cfcbce28bdbe538bc0cf37521be2.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/76210062982) has more details. It also includes information about 7 possible false positives for unstable benchmarks that are known to sometimes produce them.


-- 
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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   :warning: GitHub issue #49933 **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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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


-- 
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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   Revision: 5be0550368d94a8469e27bbba65c076d225fb19b
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-01aa4c323a](https://github.com/ursacomputing/crossbow/branches/all?query=actions-01aa4c323a)
   
   |Task|Status|
   |----|------|
   |test-conda-python-3.13-pandas-nightly-numpy-nightly|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-01aa4c323a-github-test-conda-python-3.13-pandas-nightly-numpy-nightly)](https://github.com/ursacomputing/crossbow/actions/runs/25483043213/job/74771638841)|
   |test-conda-python-3.13-pandas-upstream_devel-numpy-nightly|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-01aa4c323a-github-test-conda-python-3.13-pandas-upstream_devel-numpy-nightly)](https://github.com/ursacomputing/crossbow/actions/runs/25483043358/job/74771638920)|
   |wheel-windows-cp314-cp314t-amd64|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-01aa4c323a-github-wheel-windows-cp314-cp314t-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/25483043676/job/74771639613)|


-- 
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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   @AnkitAhlawat7742 thanks for the PR!


-- 
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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   @github-actions crossbow submit test-conda-python*numpy-nightly wheel-windows-cp314-cp314t-amd64


-- 
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-49933: [Python] Fix test_table_column_subset_metadata to set freq on correct object [arrow]

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

   After merging your PR, Conbench analyzed the 0 benchmarking runs that have been run so far on merge-commit 35667adc8ab4cfcbce28bdbe538bc0cf37521be2.
   
   None of the specified runs were found on the Conbench server.
   
   The [full Conbench report](https://github.com/apache/arrow/runs/74790167509) has more details.


-- 
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