Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-16548

[Python] Fix test_parquet_invalid_version test when no parquet or dataset are defined

    XMLWordPrintableJSON

Details

    Description

      Working on the minimal_builds I have found that when building arrow and pyarrow without DATASET nor PARQUET the following error happens:

          def test_parquet_invalid_version(tempdir):
              table = pa.table({'a': [1, 2, 3]})
              with pytest.raises(ValueError, match="Unsupported Parquet format version"):
      >           _write_table(table, tempdir / 'test_version.parquet', version="2.2")
      E           NameError: name '_write_table' is not defined
      
      pyarrow/tests/parquet/test_basic.py:52: NameError

      This is the first test on the parquet/test_basic.py module.

      I have done some investigation and if I change the test order (move that test on the file), the test that fails is a different one, always the first test on the module.
      If I import (but not use)  from pyarrow.tests.parquet.common import pytestmark no test failures happen.

      There seems to be a bug on how the pytestmark is injected. I am creating a ticket because it seems it might require more than a MINOR fix.

      Attachments

        Issue Links

          Activity

            People

              raulcd Raúl Cumplido
              raulcd Raúl Cumplido
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h