Repository: pandas-dev/pandas
Pull request #55653 (2023-10-23 21:16:37)

CI: Fix pyreadstat upgrade change
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.



Patch:
diff --git a/pandas/_libs/parsers.pyx b/pandas/_libs/parsers.pyx
index 5f51f48b43..ed8ec38b56 100644
--- a/pandas/_libs/parsers.pyx
+++ b/pandas/_libs/parsers.pyx
@@ -993,7 +993,7 @@ cdef class TextReader:
             missing_usecols = [col for col in self.usecols if col >= num_cols]
             if missing_usecols:
                 raise ParserError(
-                    "Defining usecols without of bounds indices is not allowed. "
+                    "Defining usecols with out-of-bounds indices is not allowed. "
                     f"{missing_usecols} are out of bounds.",
                 )
 
diff --git a/pandas/io/parsers/python_parser.py b/pandas/io/parsers/python_parser.py
index 43fb4ec3b5..fae3293414 100644
--- a/pandas/io/parsers/python_parser.py
+++ b/pandas/io/parsers/python_parser.py
@@ -615,8 +615,8 @@ class PythonParser(ParserBase):
                 ]
                 if missing_usecols:
                     raise ParserError(
-                        "Defining usecols without of bounds indices is not allowed. "
-                        f"{missing_usecols} are out of bounds.",
+                        "Defining usecols with out-of-bounds indices is not allowed. "
+                        f"{missing_usecols} are out-of-bounds.",
                     )
                 col_indices = self.usecols
 


Test patch:
diff --git a/pandas/tests/io/parser/usecols/test_usecols_basic.py b/pandas/tests/io/parser/usecols/test_usecols_basic.py
index e1ae2e8f36..2388d9da3f 100644
--- a/pandas/tests/io/parser/usecols/test_usecols_basic.py
+++ b/pandas/tests/io/parser/usecols/test_usecols_basic.py
@@ -467,7 +467,7 @@ def test_usecols_indices_out_of_bounds(all_parsers, names):
 a,b
 1,2
     """
-    with pytest.raises(ParserError, match="Defining usecols without of bounds"):
+    with pytest.raises(ParserError, match="Defining usecols with out-of-bounds"):
         parser.read_csv(StringIO(data), usecols=[0, 2], names=names, header=0)
 
 
diff --git a/pandas/tests/io/test_spss.py b/pandas/tests/io/test_spss.py
index b612b64e3b..10ad5f8991 100644
--- a/pandas/tests/io/test_spss.py
+++ b/pandas/tests/io/test_spss.py
@@ -1,3 +1,4 @@
+import datetime
 from pathlib import Path
 
 import numpy as np
@@ -5,6 +6,7 @@ import pytest
 
 import pandas as pd
 import pandas._testing as tm
+from pandas.util.version import Version
 
 pyreadstat = pytest.importorskip("pyreadstat")
 
@@ -147,4 +149,11 @@ def test_spss_metadata(datapath):
         "file_label": None,
         "file_format": "sav/zsav",
     }
+    if Version(pyreadstat.__version__) >= Version("1.2.4"):
+        metadata.update(
+            {
+                "creation_time": datetime.datetime(2015, 2, 6, 14, 33, 36),
+                "modification_time": datetime.datetime(2015, 2, 6, 14, 33, 36),
+            }
+        )
     assert df.attrs == metadata