From 08184ff39659f3d828e1233da4340223576e76bf Mon Sep 17 00:00:00 2001 From: Mohamed Amine ZGHAL Date: Sun, 15 Sep 2019 15:11:32 +0200 Subject: [PATCH 1/2] DOC: fix docstring of core.comon.pipe (PR02) (#28449) --- pandas/core/common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/common.py b/pandas/core/common.py index cf113c8aecbfe..565f5076fdddb 100644 --- a/pandas/core/common.py +++ b/pandas/core/common.py @@ -445,15 +445,15 @@ def pipe(obj, func, *args, **kwargs): Parameters ---------- - func : callable or tuple of (callable, string) + func : callable or tuple of (callable, str) Function to apply to this object or, alternatively, a ``(callable, data_keyword)`` tuple where ``data_keyword`` is a string indicating the keyword of `callable`` that expects the object. - args : iterable, optional - positional arguments passed into ``func``. - kwargs : dict, optional - a dictionary of keyword arguments passed into ``func``. + *args : iterable, optional + Positional arguments passed into ``func``. + **kwargs : dict, optional + A dictionary of keyword arguments passed into ``func``. Returns ------- From 3f0e8162e2866411bc98d7317ffc76105b5f2af5 Mon Sep 17 00:00:00 2001 From: John G Evans Date: Sun, 15 Sep 2019 09:13:59 -0400 Subject: [PATCH 2/2] TST: Fix sqlite3 transactions test (#28450) The sqlite connection is already in transaction when the test starts, so when the test intentionally raises an exception, the entire transaction, including the table creation, gets rolled back, so there is no table to query. Wrapping the table CREATE statement in its own transaction avoids the issue. --- pandas/tests/io/test_sql.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 25727447b4c6f..89bc98b5a1006 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -26,8 +26,6 @@ import numpy as np import pytest -from pandas.compat import PY36 - from pandas.core.dtypes.common import is_datetime64_dtype, is_datetime64tz_dtype import pandas as pd @@ -538,11 +536,11 @@ def _to_sql_save_index(self): assert ix_cols == [["A"]] def _transaction_test(self): - self.pandasSQL.execute("CREATE TABLE test_trans (A INT, B TEXT)") - - ins_sql = "INSERT INTO test_trans (A,B) VALUES (1, 'blah')" + with self.pandasSQL.run_transaction() as trans: + trans.execute("CREATE TABLE test_trans (A INT, B TEXT)") # Make sure when transaction is rolled back, no rows get inserted + ins_sql = "INSERT INTO test_trans (A,B) VALUES (1, 'blah')" try: with self.pandasSQL.run_transaction() as trans: trans.execute(ins_sql) @@ -2213,8 +2211,6 @@ def test_to_sql_save_index(self): self._to_sql_save_index() def test_transactions(self): - if PY36: - pytest.skip("not working on python > 3.5") self._transaction_test() def _get_sqlite_column_type(self, table, column):