Skip to content

Commit

Permalink
reference to pandas-dev#24559
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Jul 2, 2021
2 parents 3de5abd + 5675cd8 commit 5b6b99b
Show file tree
Hide file tree
Showing 71 changed files with 1,121 additions and 455 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/python-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
paths-ignore:
- "doc/**"

env:
PYTEST_WORKERS: "auto"
PANDAS_CI: 1
PATTERN: "not slow and not network and not clipboard"
COVERAGE: true

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -36,7 +42,7 @@ jobs:
pip install git+https://github.com/numpy/numpy.git
pip install git+https://github.com/pytest-dev/pytest.git
pip install git+https://github.com/nedbat/coveragepy.git
pip install cython python-dateutil pytz hypothesis pytest-xdist
pip install cython python-dateutil pytz hypothesis pytest-xdist pytest-cov
pip list
- name: Build Pandas
Expand All @@ -50,7 +56,8 @@ jobs:
- name: Test with pytest
run: |
coverage run -m pytest -m 'not slow and not network and not clipboard' pandas
ci/run_tests.sh
# GH 41935
continue-on-error: true

- name: Publish test results
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ repos:
types: [text]
args: [--append-config=flake8/cython-template.cfg]
- repo: https://github.com/PyCQA/isort
rev: 5.9.0
rev: 5.9.1
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
Expand Down
5 changes: 4 additions & 1 deletion asv_bench/benchmarks/algos/isin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import numpy as np

from pandas.compat.numpy import np_version_under1p20
try:
from pandas.compat import np_version_under1p20
except ImportError:
from pandas.compat.numpy import _np_version_under1p20 as np_version_under1p20

from pandas import (
Categorical,
Expand Down
14 changes: 14 additions & 0 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,4 +832,18 @@ def function(values):
self.grouper.agg(function, engine="cython")


class Sample:
def setup(self):
N = 10 ** 3
self.df = DataFrame({"a": np.zeros(N)})
self.groups = np.arange(0, N)
self.weights = np.ones(N)

def time_sample(self):
self.df.groupby(self.groups).sample(n=1)

def time_sample_weights(self):
self.df.groupby(self.groups).sample(n=1, weights=self.weights)


from .pandas_vb_common import setup # noqa: F401 isort:skip
2 changes: 2 additions & 0 deletions ci/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ jobs:
ENV_FILE: ci/deps/azure-windows-37.yaml
CONDA_PY: "37"
PATTERN: "not slow and not network"
PYTEST_WORKERS: 2 # GH-42236

py38_np18:
ENV_FILE: ci/deps/azure-windows-38.yaml
CONDA_PY: "38"
PATTERN: "not slow and not network and not high_memory"
PYTEST_WORKERS: 2 # GH-42236

steps:
- powershell: |
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Version 1.3
.. toctree::
:maxdepth: 2

v1.3.1
v1.3.0

Version 1.2
Expand Down
9 changes: 5 additions & 4 deletions doc/source/whatsnew/v1.3.0.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _whatsnew_130:

What's new in 1.3.0 (June ??)
-----------------------------
What's new in 1.3.0 (July 2, 2021)
----------------------------------

These are the changes in pandas 1.3.0. See :ref:`release` for a full changelog
including other versions of pandas.
Expand Down Expand Up @@ -136,7 +136,7 @@ which has been revised and improved (:issue:`39720`, :issue:`39317`, :issue:`404
- Many features of the :class:`.Styler` class are now either partially or fully usable on a DataFrame with a non-unique indexes or columns (:issue:`41143`)
- One has greater control of the display through separate sparsification of the index or columns using the :ref:`new styler options <options.available>`, which are also usable via :func:`option_context` (:issue:`41142`)
- Added the option ``styler.render.max_elements`` to avoid browser overload when styling large DataFrames (:issue:`40712`)
- Added the method :meth:`.Styler.to_latex` (:issue:`21673`), which also allows some limited CSS conversion (:issue:`40731`)
- Added the method :meth:`.Styler.to_latex` (:issue:`21673`, :issue:`42320`), which also allows some limited CSS conversion (:issue:`40731`)
- Added the method :meth:`.Styler.to_html` (:issue:`13379`)
- Added the method :meth:`.Styler.set_sticky` to make index and column headers permanently visible in scrolling HTML frames (:issue:`29072`)

Expand Down Expand Up @@ -707,6 +707,7 @@ Other API changes
- Added new ``engine`` and ``**engine_kwargs`` parameters to :meth:`DataFrame.to_sql` to support other future "SQL engines". Currently we still only use ``SQLAlchemy`` under the hood, but more engines are planned to be supported such as `turbodbc <https://turbodbc.readthedocs.io/en/latest/>`_ (:issue:`36893`)
- Removed redundant ``freq`` from :class:`PeriodIndex` string representation (:issue:`41653`)
- :meth:`ExtensionDtype.construct_array_type` is now a required method instead of an optional one for :class:`ExtensionDtype` subclasses (:issue:`24860`)
- Calling ``hash`` on non-hashable pandas objects will now raise ``TypeError`` with the built-in error message (e.g. ``unhashable type: 'Series'``). Previously it would raise a custom message such as ``'Series' objects are mutable, thus they cannot be hashed``. Furthermore, ``isinstance(<Series>, abc.collections.Hashable)`` will now return ``False`` (:issue:`40013`)
- :meth:`.Styler.from_custom_template` now has two new arguments for template names, and removed the old ``name``, due to template inheritance having been introducing for better parsing (:issue:`42053`). Subclassing modifications to Styler attributes are also needed.

.. _whatsnew_130.api_breaking.build:
Expand Down Expand Up @@ -1232,4 +1233,4 @@ Other
Contributors
~~~~~~~~~~~~

.. contributors:: v1.2.5..v1.3.0|HEAD
.. contributors:: v1.2.5..v1.3.0
45 changes: 45 additions & 0 deletions doc/source/whatsnew/v1.3.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. _whatsnew_131:

What's new in 1.3.1 (July ??, 2021)
-----------------------------------

These are the changes in pandas 1.3.1. See :ref:`release` for a full changelog
including other versions of pandas.

{{ header }}

.. ---------------------------------------------------------------------------
.. _whatsnew_131.regressions:

Fixed regressions
~~~~~~~~~~~~~~~~~
-
-

.. ---------------------------------------------------------------------------
.. _whatsnew_131.bug_fixes:

Bug fixes
~~~~~~~~~
-
-

.. ---------------------------------------------------------------------------
.. _whatsnew_131.other:

Other
~~~~~
-
-

.. ---------------------------------------------------------------------------
.. _whatsnew_131.contributors:

Contributors
~~~~~~~~~~~~

.. contributors:: v1.3.0..v1.3.1|HEAD
10 changes: 6 additions & 4 deletions doc/source/whatsnew/v1.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor

Other API changes
^^^^^^^^^^^^^^^^^
-
- :meth:`Index.get_indexer_for` no longer accepts keyword arguments (other than 'target'); in the past these would be silently ignored if the index was not unique (:issue:`42310`)
-

.. ---------------------------------------------------------------------------
Expand All @@ -97,7 +97,8 @@ Other API changes
Deprecations
~~~~~~~~~~~~
- Deprecated :meth:`Index.is_type_compatible` (:issue:`42113`)
- Deprecated treating ``numpy.datetime64`` objects as UTC times when passed to the :class:`Timestamp` constructor along with a timezone. In a future version, these will be treated as wall-times. To retain the old behavior, use ``Timestamp(dt64).tz_localize("UTC").tz_convert(tz)`` (:issue:`42288`)
- Deprecated ``method`` argument in :meth:`Index.get_loc`, use ``index.get_indexer([label], method=...)`` instead (:issue:`42269`)
- Deprecated treating ``numpy.datetime64`` objects as UTC times when passed to the :class:`Timestamp` constructor along with a timezone. In a future version, these will be treated as wall-times. To retain the old behavior, use ``Timestamp(dt64).tz_localize("UTC").tz_convert(tz)`` (:issue:`24559`)
-

.. ---------------------------------------------------------------------------
Expand All @@ -106,7 +107,7 @@ Deprecations

Performance improvements
~~~~~~~~~~~~~~~~~~~~~~~~
-
- Performance improvement in :meth:`.GroupBy.sample`, especially when ``weights`` argument provided (:issue:`34483`)
-

.. ---------------------------------------------------------------------------
Expand Down Expand Up @@ -159,7 +160,7 @@ Interval

Indexing
^^^^^^^^
-
- Bug in indexing on a :class:`Series` or :class:`DataFrame` with a :class:`DatetimeIndex` when passing a string, the return type depended on whether the index was monotonic (:issue:`24892`)
-

Missing
Expand All @@ -174,6 +175,7 @@ MultiIndex

I/O
^^^
- Bug in :func:`read_excel` attempting to read chart sheets from .xlsx files (:issue:`41448`)
-
-

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/algos.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def is_monotonic(

def rank_1d(
values: np.ndarray, # ndarray[rank_t, ndim=1]
labels: np.ndarray, # const int64_t[:]
labels: np.ndarray | None = ..., # const int64_t[:]=None
is_datetimelike: bool = ...,
ties_method=...,
ascending: bool = ...,
Expand Down
Loading

0 comments on commit 5b6b99b

Please sign in to comment.