Skip to content

Commit 3b611b8

Browse files
committed
Merge branch '1.4.x' of https://github.com/pandas-dev/pandas into 1.4.x
2 parents 51f4e99 + bcc2a5d commit 3b611b8

File tree

10 files changed

+56
-14
lines changed

10 files changed

+56
-14
lines changed

.github/workflows/posix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
COVERAGE: ${{ !contains(matrix.settings[0], 'pypy') }}
5151
concurrency:
5252
# https://i.8713187.xyzmunity/t/concurrecy-not-work-for-push/183068/7
53-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}
53+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}-${{ matrix.settings[2] }}
5454
cancel-in-progress: true
5555

5656
services:

ci/deps/actions-310.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.9
5+
- python=3.10
66

77
# test dependencies
88
- cython=0.29.24

doc/source/whatsnew/v1.4.1.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ Fixed regressions
1818
- Regression in :func:`.assert_frame_equal` not respecting ``check_flags=False`` (:issue:`45554`)
1919
- Regression in :meth:`Series.fillna` with ``downcast=False`` incorrectly downcasting ``object`` dtype (:issue:`45603`)
2020
- Regression in :meth:`DataFrame.iat` setting values leading to not propagating correctly in subsequent lookups (:issue:`45684`)
21-
- Regression in :meth:`DataFrame.loc.__setitem__` losing :class:`Index` name if :class:`DataFrame` was empty before (:issue:`45621`)
22-
- Regression in :func:`join` with overlapping :class:`IntervalIndex` raising an ``InvalidIndexError`` (:issue:`45661`)
23-
21+
- Regression when setting values with :meth:`DataFrame.loc` losing :class:`Index` name if :class:`DataFrame` was empty before (:issue:`45621`)
22+
- Regression in :meth:`~Index.join` with overlapping :class:`IntervalIndex` raising an ``InvalidIndexError`` (:issue:`45661`)
23+
- Regression in :func:`read_sql` with a DBAPI2 connection that is not an instance of ``sqlite3.Connection`` incorrectly requiring SQLAlchemy be installed (:issue:`45660`)
24+
-
2425

2526
.. ---------------------------------------------------------------------------
2627
2728
.. _whatsnew_141.bug_fixes:
2829

2930
Bug fixes
3031
~~~~~~~~~
31-
- Fixed segfault in :meth:``DataFrame.to_json`` when dumping tz-aware datetimes in Python 3.10 (:issue:`42130`)
32+
- Fixed segfault in :meth:`DataFrame.to_json` when dumping tz-aware datetimes in Python 3.10 (:issue:`42130`)
3233
- Stopped emitting unnecessary ``FutureWarning`` in :meth:`DataFrame.sort_values` with sparse columns (:issue:`45618`)
3334
- Fixed window aggregations in :meth:`DataFrame.rolling` and :meth:`Series.rolling` to skip over unused elements (:issue:`45647`)
3435
- Bug in :func:`api.types.is_bool_dtype` was raising an ``AttributeError`` when evaluating a categorical :class:`Series` (:issue:`45615`)

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies:
3535
- sphinx
3636
- sphinx-panels
3737
- numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
38+
- pydata-sphinx-theme
3839
- types-python-dateutil
3940
- types-PyMySQL
4041
- types-pytz
@@ -120,6 +121,5 @@ dependencies:
120121
- tabulate>=0.8.3 # DataFrame.to_markdown
121122
- natsort # DataFrame.sort_values
122123
- pip:
123-
- pydata-sphinx-theme
124124
- pandas-dev-flaker==0.2.0
125125
- pytest-cython

pandas/io/sql.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,15 @@ def pandasSQL_builder(con, schema: str | None = None):
747747
if isinstance(con, sqlite3.Connection) or con is None:
748748
return SQLiteDatabase(con)
749749

750-
sqlalchemy = import_optional_dependency("sqlalchemy")
750+
sqlalchemy = import_optional_dependency("sqlalchemy", errors="ignore")
751751

752752
if isinstance(con, str):
753-
con = sqlalchemy.create_engine(con)
753+
if sqlalchemy is None:
754+
raise ImportError("Using URI string without sqlalchemy installed.")
755+
else:
756+
con = sqlalchemy.create_engine(con)
754757

755-
if isinstance(con, sqlalchemy.engine.Connectable):
758+
if sqlalchemy is not None and isinstance(con, sqlalchemy.engine.Connectable):
756759
return SQLDatabase(con, schema=schema)
757760

758761
warnings.warn(

pandas/tests/base/test_unique.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def test_nunique_null(null_obj, index_or_series_obj):
105105

106106

107107
@pytest.mark.single
108+
@pytest.mark.xfail(
109+
reason="Flaky in the CI. Remove once CI has a single build: GH 44584", strict=False
110+
)
108111
def test_unique_bad_unicode(index_or_series):
109112
# regression test for #34550
110113
uval = "\ud83d" # smiley emoji

pandas/tests/io/parser/test_network.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
StringIO,
88
)
99
import logging
10+
import os
1011

1112
import numpy as np
1213
import pytest
@@ -256,6 +257,12 @@ def test_read_csv_handles_boto_s3_object(self, s3_resource, tips_file):
256257
expected = read_csv(tips_file)
257258
tm.assert_frame_equal(result, expected)
258259

260+
@pytest.mark.skipif(
261+
os.environ.get("PANDAS_CI", "0") == "1",
262+
reason="This test can hang in our CI min_versions build "
263+
"and leads to '##[error]The runner has "
264+
"received a shutdown signal...' in GHA. GH: 45651",
265+
)
259266
def test_read_csv_chunked_download(self, s3_resource, caplog, s3so):
260267
# 8 MB, S3FS uses 5MB chunks
261268
import s3fs

pandas/tests/io/test_sql.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,9 +1534,25 @@ def test_sql_open_close(self, test_frame3):
15341534
@pytest.mark.skipif(SQLALCHEMY_INSTALLED, reason="SQLAlchemy is installed")
15351535
def test_con_string_import_error(self):
15361536
conn = "mysql://root@localhost/pandas"
1537-
with pytest.raises(ImportError, match="SQLAlchemy"):
1537+
msg = "Using URI string without sqlalchemy installed"
1538+
with pytest.raises(ImportError, match=msg):
15381539
sql.read_sql("SELECT * FROM iris", conn)
15391540

1541+
@pytest.mark.skipif(SQLALCHEMY_INSTALLED, reason="SQLAlchemy is installed")
1542+
def test_con_unknown_dbapi2_class_does_not_error_without_sql_alchemy_installed(
1543+
self,
1544+
):
1545+
class MockSqliteConnection:
1546+
def __init__(self, *args, **kwargs):
1547+
self.conn = sqlite3.Connection(*args, **kwargs)
1548+
1549+
def __getattr__(self, name):
1550+
return getattr(self.conn, name)
1551+
1552+
conn = MockSqliteConnection(":memory:")
1553+
with tm.assert_produces_warning(UserWarning):
1554+
sql.read_sql("SELECT 1", conn)
1555+
15401556
def test_read_sql_delegate(self):
15411557
iris_frame1 = sql.read_sql_query("SELECT * FROM iris", self.conn)
15421558
iris_frame2 = sql.read_sql("SELECT * FROM iris", self.conn)

pandas/tests/io/test_user_agent.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import http.server
66
from io import BytesIO
77
import multiprocessing
8+
import os
89
import socket
910
import time
1011
import urllib.error
@@ -16,6 +17,13 @@
1617
import pandas as pd
1718
import pandas._testing as tm
1819

20+
pytestmark = pytest.mark.skipif(
21+
os.environ.get("PANDAS_CI", "0") == "1",
22+
reason="This test can hang in our CI min_versions build "
23+
"and leads to '##[error]The runner has "
24+
"received a shutdown signal...' in GHA. GH 45651",
25+
)
26+
1927

2028
class BaseUserAgentResponder(http.server.BaseHTTPRequestHandler):
2129
"""
@@ -242,7 +250,9 @@ def responder(request):
242250
pd.read_parquet,
243251
"fastparquet",
244252
# TODO(ArrayManager) fastparquet
245-
marks=td.skip_array_manager_not_yet_implemented,
253+
marks=[
254+
td.skip_array_manager_not_yet_implemented,
255+
],
246256
),
247257
(PickleUserAgentResponder, pd.read_pickle, None),
248258
(StataUserAgentResponder, pd.read_stata, None),
@@ -277,7 +287,9 @@ def test_server_and_default_headers(responder, read_method, parquet_engine):
277287
pd.read_parquet,
278288
"fastparquet",
279289
# TODO(ArrayManager) fastparquet
280-
marks=td.skip_array_manager_not_yet_implemented,
290+
marks=[
291+
td.skip_array_manager_not_yet_implemented,
292+
],
281293
),
282294
(PickleUserAgentResponder, pd.read_pickle, None),
283295
(StataUserAgentResponder, pd.read_stata, None),

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ gitdb
2121
sphinx
2222
sphinx-panels
2323
numpydoc < 1.2
24+
pydata-sphinx-theme
2425
types-python-dateutil
2526
types-PyMySQL
2627
types-pytz
@@ -83,7 +84,6 @@ cftime
8384
pyreadstat
8485
tabulate>=0.8.3
8586
natsort
86-
pydata-sphinx-theme
8787
pandas-dev-flaker==0.2.0
8888
pytest-cython
8989
setuptools>=51.0.0

0 commit comments

Comments
 (0)