Skip to content

Commit 946edbf

Browse files
committed
Merge branch 'main' of https://github.com/dannyi96/pandas into today_now_error
2 parents 2f2f1eb + 61464f8 commit 946edbf

File tree

136 files changed

+1567
-589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1567
-589
lines changed

.github/workflows/codeql.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CodeQL
2+
on:
3+
schedule:
4+
# every day at midnight
5+
- cron: "0 0 * * *"
6+
7+
concurrency:
8+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
analyze:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language:
23+
- python
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: github/codeql-action/init@v2
28+
with:
29+
languages: ${{ matrix.language }}
30+
- uses: github/codeql-action/autobuild@v2
31+
- uses: github/codeql-action/analyze@v2

.github/workflows/sdist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ jobs:
7979
run: |
8080
case "${{matrix.python-version}}" in
8181
3.8)
82-
pip install numpy==1.19.5 ;;
82+
pip install numpy==1.20.3 ;;
8383
3.9)
84-
pip install numpy==1.19.5 ;;
84+
pip install numpy==1.20.3 ;;
8585
3.10)
8686
pip install numpy==1.21.2 ;;
8787
esac

.pre-commit-config.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,42 @@ repos:
8585
- repo: local
8686
hooks:
8787
- id: pyright
88+
# note: assumes python env is setup and activated
8889
name: pyright
8990
entry: pyright
90-
# note: assumes python env is setup and activated
9191
language: node
9292
pass_filenames: false
9393
types: [python]
9494
stages: [manual]
9595
additional_dependencies: &pyright_dependencies
96-
- pyright@1.1.262
96+
- pyright@1.1.264
9797
- id: pyright_reportGeneralTypeIssues
98+
# note: assumes python env is setup and activated
9899
name: pyright reportGeneralTypeIssues
99100
entry: pyright --skipunannotated -p pyright_reportGeneralTypeIssues.json
100-
# note: assumes python env is setup and activated
101101
language: node
102102
pass_filenames: false
103103
types: [python]
104104
stages: [manual]
105105
additional_dependencies: *pyright_dependencies
106106
- id: mypy
107+
# note: assumes python env is setup and activated
107108
name: mypy
108109
entry: mypy
109-
# note: assumes python env is setup and activated
110110
language: system
111111
pass_filenames: false
112112
types: [python]
113113
stages: [manual]
114+
- id: stubtest
115+
# note: assumes python env is setup and activated
116+
# note: requires pandas dev to be installed
117+
name: mypy (stubtest)
118+
entry: python
119+
language: system
120+
pass_filenames: false
121+
types: [pyi]
122+
args: [scripts/run_stubtest.py]
123+
stages: [manual]
114124
- id: flake8-rst
115125
name: flake8-rst
116126
description: Run flake8 on code snippets in docstrings or RST files

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ fi
7878
### DOCSTRINGS ###
7979
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8080

81-
MSG='Validate docstrings (EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05)' ; echo $MSG
82-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05
81+
MSG='Validate docstrings (EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
82+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06
8383
RET=$(($RET + $?)) ; echo $MSG "DONE"
8484

8585
fi

ci/deps/actions-310-numpydev.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ dependencies:
1616
- pytz
1717
- pip
1818
- pip:
19-
#- cython # TODO: don't install from master after Cython 3.0.0a11 is released
20-
- "git+https://github.com/cython/cython.git@master"
19+
- "cython"
2120
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2221
- "--pre"
2322
- "numpy"

ci/deps/actions-310.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.10
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.30
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31

ci/deps/actions-38-downstream_compat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.8
77

88
# test dependencies
9-
- cython=0.29.30
9+
- cython>=0.29.30
1010
- pytest>=6.0
1111
- pytest-cov
1212
- pytest-xdist>=1.31

ci/deps/actions-38-minimum_versions.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77
- python=3.8.0
88

99
# test dependencies
10-
- cython=0.29.30
10+
- cython>=0.29.30
1111
- pytest>=6.0
1212
- pytest-cov
1313
- pytest-xdist>=1.31
@@ -17,7 +17,7 @@ dependencies:
1717

1818
# required dependencies
1919
- python-dateutil=2.8.1
20-
- numpy=1.19.5
20+
- numpy=1.20.3
2121
- pytz=2020.1
2222

2323
# optional dependencies

ci/deps/actions-38.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.8
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.30
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31

ci/deps/actions-39.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.9
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.30
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31

ci/deps/circle-38-arm64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.8
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.30
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31

doc/source/conf.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,25 @@
5050
# sphinxext.
5151

5252
extensions = [
53-
"sphinx.ext.autodoc",
54-
"sphinx.ext.autosummary",
55-
"sphinx.ext.doctest",
56-
"sphinx.ext.extlinks",
57-
"sphinx.ext.todo",
58-
"numpydoc", # handle NumPy documentation formatted docstrings
53+
"contributors", # custom pandas extension
5954
"IPython.sphinxext.ipython_directive",
6055
"IPython.sphinxext.ipython_console_highlighting",
6156
"matplotlib.sphinxext.plot_directive",
62-
"sphinx.ext.intersphinx",
57+
"numpydoc",
58+
"sphinx_copybutton",
59+
"sphinx_panels",
60+
"sphinx_toggleprompt",
61+
"sphinx.ext.autodoc",
62+
"sphinx.ext.autosummary",
6363
"sphinx.ext.coverage",
64-
"sphinx.ext.mathjax",
64+
"sphinx.ext.doctest",
65+
"sphinx.ext.extlinks",
6566
"sphinx.ext.ifconfig",
67+
"sphinx.ext.intersphinx",
6668
"sphinx.ext.linkcode",
69+
"sphinx.ext.mathjax",
70+
"sphinx.ext.todo",
6771
"nbsphinx",
68-
"sphinx_panels",
69-
"contributors", # custom pandas extension
7072
]
7173

7274
exclude_patterns = [
@@ -144,6 +146,9 @@
144146
# already loads it
145147
panels_add_bootstrap_css = False
146148

149+
# https://sphinx-toggleprompt.readthedocs.io/en/stable/#offset
150+
toggleprompt_offset_right = 35
151+
147152
# Add any paths that contain templates here, relative to this directory.
148153
templates_path = ["../_templates"]
149154

@@ -453,7 +458,6 @@
453458
# extlinks alias
454459
extlinks = {
455460
"issue": ("https://github.com/pandas-dev/pandas/issues/%s", "GH"),
456-
"wiki": ("https://github.com/pandas-dev/pandas/wiki/%s", "wiki "),
457461
}
458462

459463

doc/source/getting_started/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Dependencies
235235
================================================================ ==========================
236236
Package Minimum supported version
237237
================================================================ ==========================
238-
`NumPy <https://numpy.org>`__ 1.19.5
238+
`NumPy <https://numpy.org>`__ 1.20.3
239239
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.8.1
240240
`pytz <https://pypi.org/project/pytz/>`__ 2020.1
241241
================================================================ ==========================

doc/source/reference/general_functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ Importing from other DataFrame libraries
8585
.. autosummary::
8686
:toctree: api/
8787

88-
api.exchange.from_dataframe
88+
api.interchange.from_dataframe

doc/source/whatsnew/v1.4.4.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Bug fixes
2626
~~~~~~~~~
2727
- The :class:`errors.FutureWarning` raised when passing arguments (other than ``filepath_or_buffer``) as positional in :func:`read_csv` is now raised at the correct stacklevel (:issue:`47385`)
2828
- Bug in :meth:`DataFrame.to_sql` when ``method`` was a ``callable`` that did not return an ``int`` and would raise a ``TypeError`` (:issue:`46891`)
29+
- Bug in :func:`read_xml` when reading XML files with Chinese character tags and would raise ``XMLSyntaxError`` (:issue:`47902`)
2930

3031
.. ---------------------------------------------------------------------------
3132

doc/source/whatsnew/v1.5.0.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ If installed, we now require:
416416
+-----------------+-----------------+----------+---------+
417417
| Package | Minimum Version | Required | Changed |
418418
+=================+=================+==========+=========+
419-
| numpy | 1.19.5 | X | X |
419+
| numpy | 1.20.3 | X | X |
420420
+-----------------+-----------------+----------+---------+
421-
| mypy (dev) | 0.960 | | X |
421+
| mypy (dev) | 0.971 | | X |
422422
+-----------------+-----------------+----------+---------+
423423
| beautifulsoup4 | 4.9.3 | | X |
424424
+-----------------+-----------------+----------+---------+
@@ -770,9 +770,13 @@ Other Deprecations
770770
- Deprecated the argument ``na_sentinel`` in :func:`factorize`, :meth:`Index.factorize`, and :meth:`.ExtensionArray.factorize`; pass ``use_na_sentinel=True`` instead to use the sentinel ``-1`` for NaN values and ``use_na_sentinel=False`` instead of ``na_sentinel=None`` to encode NaN values (:issue:`46910`)
771771
- Deprecated :meth:`DataFrameGroupBy.transform` not aligning the result when the UDF returned DataFrame (:issue:`45648`)
772772
- Clarified warning from :func:`to_datetime` when delimited dates can't be parsed in accordance to specified ``dayfirst`` argument (:issue:`46210`)
773+
- Emit warning from :func:`to_datetime` when delimited dates can't be parsed in accordance to specified ``dayfirst`` argument even for dates where leading zero is omitted (e.g. ``31/1/2001``) (:issue:`47880`)
773774
- Deprecated :class:`Series` and :class:`Resampler` reducers (e.g. ``min``, ``max``, ``sum``, ``mean``) raising a ``NotImplementedError`` when the dtype is non-numric and ``numeric_only=True`` is provided; this will raise a ``TypeError`` in a future version (:issue:`47500`)
774775
- Deprecated :meth:`Series.rank` returning an empty result when the dtype is non-numeric and ``numeric_only=True`` is provided; this will raise a ``TypeError`` in a future version (:issue:`47500`)
775776
- Deprecated argument ``errors`` for :meth:`Series.mask`, :meth:`Series.where`, :meth:`DataFrame.mask`, and :meth:`DataFrame.where` as ``errors`` had no effect on this methods (:issue:`47728`)
777+
- Deprecated arguments ``*args`` and ``**kwargs`` in :class:`Rolling`, :class:`Expanding`, and :class:`ExponentialMovingWindow` ops. (:issue:`47836`)
778+
- Deprecated unused arguments ``encoding`` and ``verbose`` in :meth:`Series.to_excel` and :meth:`DataFrame.to_excel` (:issue:`47912`)
779+
- Deprecated producing a single element when iterating over a :class:`DataFrameGroupBy` or a :class:`SeriesGroupBy` that has been grouped by a list of length 1; A tuple of length one will be returned instead (:issue:`42795`)
776780

777781
.. ---------------------------------------------------------------------------
778782
.. _whatsnew_150.performance:
@@ -909,6 +913,7 @@ Indexing
909913
- Bug in :meth:`NDFrame.xs`, :meth:`DataFrame.iterrows`, :meth:`DataFrame.loc` and :meth:`DataFrame.iloc` not always propagating metadata (:issue:`28283`)
910914
- Bug in :meth:`DataFrame.sum` min_count changes dtype if input contains NaNs (:issue:`46947`)
911915
- Bug in :class:`IntervalTree` that lead to an infinite recursion. (:issue:`46658`)
916+
- Bug in :class:`PeriodIndex` raising ``AttributeError`` when indexing on ``NA``, rather than putting ``NaT`` in its place. (:issue:`46673`)
912917
-
913918

914919
Missing
@@ -1024,6 +1029,7 @@ Reshaping
10241029
- Bug in :meth:`DataFrame.pivot_table` with ``sort=False`` results in sorted index (:issue:`17041`)
10251030
- Bug in :meth:`concat` when ``axis=1`` and ``sort=False`` where the resulting Index was a :class:`Int64Index` instead of a :class:`RangeIndex` (:issue:`46675`)
10261031
- Bug in :meth:`wide_to_long` raises when ``stubnames`` is missing in columns and ``i`` contains string dtype column (:issue:`46044`)
1032+
- Bug in :meth:`DataFrame.join` with categorical index results in unexpected reordering (:issue:`47812`)
10271033

10281034
Sparse
10291035
^^^^^^
@@ -1043,6 +1049,7 @@ Styler
10431049
- Bug in :meth:`Styler.set_sticky` leading to white text on white background in dark mode (:issue:`46984`)
10441050
- Bug in :meth:`Styler.to_latex` causing ``UnboundLocalError`` when ``clines="all;data"`` and the ``DataFrame`` has no rows. (:issue:`47203`)
10451051
- Bug in :meth:`Styler.to_excel` when using ``vertical-align: middle;`` with ``xlsxwriter`` engine (:issue:`30107`)
1052+
- Bug when applying styles to a DataFrame with boolean column labels (:issue:`47838`)
10461053

10471054
Metadata
10481055
^^^^^^^^

environment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ dependencies:
8888
- flake8-bugbear=21.3.2 # used by flake8, find likely bugs
8989
- flake8-comprehensions=3.7.0 # used by flake8, linting of unnecessary comprehensions
9090
- isort>=5.2.1 # check that imports are in the right order
91-
- mypy=0.960
91+
- mypy=0.971
9292
- pre-commit>=2.15.0
9393
- pycodestyle # used by flake8
9494
- pyupgrade
@@ -103,6 +103,7 @@ dependencies:
103103
- pytest-cython # doctest
104104
- sphinx
105105
- sphinx-panels
106+
- sphinx-copybutton
106107
- types-python-dateutil
107108
- types-PyMySQL
108109
- types-pytz
@@ -128,3 +129,4 @@ dependencies:
128129
- jupyterlab >=3.4,<4
129130
- pip:
130131
- jupyterlite==0.1.0b10
132+
- sphinx-toggleprompt

pandas/_config/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ class RegisteredOption(NamedTuple):
102102

103103
class OptionError(AttributeError, KeyError):
104104
"""
105-
Exception for pandas.options, backwards compatible with KeyError
106-
checks.
105+
Exception raised for pandas.options.
106+
107+
Backwards compatible with KeyError checks.
107108
"""
108109

109110

pandas/_libs/groupby.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def group_any_all(
5050
val_test: Literal["any", "all"],
5151
skipna: bool,
5252
) -> None: ...
53-
def group_add(
53+
def group_sum(
5454
out: np.ndarray, # complexfloating_t[:, ::1]
5555
counts: np.ndarray, # int64_t[::1]
5656
values: np.ndarray, # ndarray[complexfloating_t, ndim=2]

0 commit comments

Comments
 (0)