New release of pandas 0.25.3 (python 3.8 support included)

This commit is contained in:
Sergio Pascual 2019-11-11 11:53:28 +01:00
parent f6ee39d9e9
commit 575d83a0dc
4 changed files with 7 additions and 135 deletions

1
.gitignore vendored
View File

@ -26,3 +26,4 @@
/pandas-0.23.4.tar.gz /pandas-0.23.4.tar.gz
/pandas-0.24.1.tar.gz /pandas-0.24.1.tar.gz
/pandas-0.25.1.tar.gz /pandas-0.25.1.tar.gz
/pandas-0.25.3.tar.gz

View File

@ -1,129 +0,0 @@
From cd2d804b80a9fa5aa9302d75cd927603ab80a7f0 Mon Sep 17 00:00:00 2001
From: MeeseeksMachine <39504233+meeseeksmachine@users.noreply.github.com>
Date: Mon, 26 Aug 2019 10:09:25 -0700
Subject: [PATCH] Backport PR #28101: COMPAT: implement visit_Constant for 3.8
compat (#28146)
---
pandas/compat/__init__.py | 1 +
pandas/core/computation/expr.py | 3 +++
pandas/tests/computation/test_eval.py | 27 +++++++++++++++++++++++++--
pandas/tests/io/parser/test_common.py | 5 ++++-
pandas/tests/scalar/test_nat.py | 3 +++
6 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py
index b32da8da3a1..9c778f68727 100644
--- a/pandas/compat/__init__.py
+++ b/pandas/compat/__init__.py
@@ -15,6 +15,7 @@
PY35 = sys.version_info[:2] == (3, 5)
PY36 = sys.version_info >= (3, 6)
PY37 = sys.version_info >= (3, 7)
+PY38 = sys.version_info >= (3, 8)
PYPY = platform.python_implementation() == "PyPy"
diff --git a/pandas/core/computation/expr.py b/pandas/core/computation/expr.py
index 772fb547567..64bafbc694f 100644
--- a/pandas/core/computation/expr.py
+++ b/pandas/core/computation/expr.py
@@ -582,6 +582,9 @@ def visit_NameConstant(self, node, **kwargs):
def visit_Num(self, node, **kwargs):
return self.const_type(node.n, self.env)
+ def visit_Constant(self, node, **kwargs):
+ return self.const_type(node.n, self.env)
+
def visit_Str(self, node, **kwargs):
name = self.env.add_tmp(node.s)
return self.term_type(name, self.env)
diff --git a/pandas/tests/computation/test_eval.py b/pandas/tests/computation/test_eval.py
index c500760fa13..b6ffd8a83e4 100644
--- a/pandas/tests/computation/test_eval.py
+++ b/pandas/tests/computation/test_eval.py
@@ -14,7 +14,7 @@
from pandas.core.dtypes.common import is_bool, is_list_like, is_scalar
import pandas as pd
-from pandas import DataFrame, Series, date_range
+from pandas import DataFrame, Series, compat, date_range
from pandas.core.computation import pytables
from pandas.core.computation.check import _NUMEXPR_VERSION
from pandas.core.computation.engines import NumExprClobberingError, _engines
@@ -1267,7 +1267,10 @@ def test_assignment_column(self):
msg = "left hand side of an assignment must be a single name"
with pytest.raises(SyntaxError, match=msg):
df.eval("d,c = a + b")
- msg = "can't assign to function call"
+ if compat.PY38:
+ msg = "cannot assign to function call"
+ else:
+ msg = "can't assign to function call"
with pytest.raises(SyntaxError, match=msg):
df.eval('Timestamp("20131001") = a + b')
@@ -1967,6 +1970,26 @@ def test_bool_ops_fails_on_scalars(lhs, cmp, rhs, engine, parser):
pd.eval(ex, engine=engine, parser=parser)
+@pytest.mark.parametrize(
+ "other",
+ [
+ "'x'",
+ pytest.param(
+ "...", marks=pytest.mark.xfail(not compat.PY38, reason="GH-28116")
+ ),
+ ],
+)
+def test_equals_various(other):
+ df = DataFrame({"A": ["a", "b", "c"]})
+ result = df.eval("A == {}".format(other))
+ expected = Series([False, False, False], name="A")
+ if _USE_NUMEXPR:
+ # https://github.com/pandas-dev/pandas/issues/10239
+ # lose name with numexpr engine. Remove when that's fixed.
+ expected.name = None
+ tm.assert_series_equal(result, expected)
+
+
def test_inf(engine, parser):
s = "inf + 1"
expected = np.inf
diff --git a/pandas/tests/io/parser/test_common.py b/pandas/tests/io/parser/test_common.py
index b94d5cd497c..4a54d43de66 100644
--- a/pandas/tests/io/parser/test_common.py
+++ b/pandas/tests/io/parser/test_common.py
@@ -1898,7 +1898,10 @@ def test_null_byte_char(all_parsers):
out = parser.read_csv(StringIO(data), names=names)
tm.assert_frame_equal(out, expected)
else:
- msg = "NULL byte detected"
+ if compat.PY38:
+ msg = "line contains NUL"
+ else:
+ msg = "NULL byte detected"
with pytest.raises(ParserError, match=msg):
parser.read_csv(StringIO(data), names=names)
diff --git a/pandas/tests/scalar/test_nat.py b/pandas/tests/scalar/test_nat.py
index f935a7fa880..90ae6d5dab8 100644
--- a/pandas/tests/scalar/test_nat.py
+++ b/pandas/tests/scalar/test_nat.py
@@ -248,6 +248,7 @@ def _get_overlap_public_nat_methods(klass, as_tuple=False):
"day_name",
"dst",
"floor",
+ "fromisocalendar",
"fromisoformat",
"fromordinal",
"fromtimestamp",
@@ -292,6 +293,8 @@ def test_overlap_public_nat_methods(klass, expected):
# "fromisoformat" was introduced in 3.7
if klass is Timestamp and not compat.PY37:
expected.remove("fromisoformat")
+ if klass is Timestamp and not compat.PY38:
+ expected.remove("fromisocalendar")
assert _get_overlap_public_nat_methods(klass) == expected

View File

@ -2,16 +2,13 @@
Name: python-%{srcname} Name: python-%{srcname}
Version: 0.25.1 Version: 0.25.3
Release: 2%{?dist} Release: 1%{?dist}
Summary: Python library providing high-performance data analysis tools Summary: Python library providing high-performance data analysis tools
License: BSD License: BSD
URL: https://pandas.pydata.org/ URL: https://pandas.pydata.org/
Source0: https://pypi.io/packages/source/p/pandas/%{srcname}-%{version}.tar.gz Source0: https://pypi.io/packages/source/p/pandas/%{srcname}-%{version}.tar.gz
# Fix Python 3.8.
# https://github.com/pandas-dev/pandas/pull/28101
Patch0001: https://github.com/pandas-dev/pandas/commit/cd2d804b80a9fa5aa9302d75cd927603ab80a7f0.patch
%global _description %{expand: %global _description %{expand:
pandas is an open source, BSD-licensed library providing pandas is an open source, BSD-licensed library providing
@ -63,6 +60,9 @@ Recommends: python3-xlwt
%{python3_sitearch}/%{srcname}* %{python3_sitearch}/%{srcname}*
%changelog %changelog
* Mon Nov 11 2019 Sergio Pascual <sergiopr@fedoraproject.org> - 0.25.3-1
- New release of pandas 0.25.3 (python 3.8 support included)
* Fri Sep 13 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.25.1-2 * Fri Sep 13 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.25.1-2
- Backport patch for Python 3.8 compatibility - Backport patch for Python 3.8 compatibility

View File

@ -1 +1 @@
SHA512 (pandas-0.25.1.tar.gz) = 5ca8991d4355011741ca046b72d426db47c1e0931aa30a90826959defd3577a28ba6c413798d9f45b3a1864701e100f51fbfac42c37c0edb79b1385893d3b1a3 SHA512 (pandas-0.25.3.tar.gz) = ab282e4d3145daafa68d5e3a2e82d692385eb62720d6503ddb3a4f76cf380591cbd32ba3e15fa5ba93725a221d3f74062012ca13a0df8e08c324e706ca35ccf6