Skip to content

Commit 36eb26f

Browse files
Merge remote-tracking branch 'upstream/main' into td64-tests
2 parents 42e597c + 04e01a1 commit 36eb26f

Some content is hidden

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

57 files changed

+773
-286
lines changed

.github/actions/build_pandas/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ runs:
1212

1313
- name: Build Pandas
1414
run: |
15-
python setup.py build_ext -j 2
15+
python setup.py build_ext -j $N_JOBS
1616
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
1717
shell: bash -el {0}
18+
env:
19+
# Cannot use parallel compilation on Windows, see https://github.com/pandas-dev/pandas/issues/30873
20+
N_JOBS: ${{ runner.os == 'Windows' && 1 || 2 }}

.github/workflows/code-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474

7575
- name: Install pyright
7676
# note: keep version in sync with .pre-commit-config.yaml
77-
run: npm install -g [email protected].230
77+
run: npm install -g [email protected].245
7878

7979
- name: Build Pandas
8080
id: build

.github/workflows/posix.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ jobs:
180180
run: ci/run_tests.sh
181181
# TODO: Don't continue on error for PyPy
182182
continue-on-error: ${{ env.IS_PYPY == 'true' }}
183-
if: always()
184183

185184
- name: Build Version
186185
run: conda list

.github/workflows/windows.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.4.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.4.x
12+
paths-ignore:
13+
- "doc/**"
14+
15+
env:
16+
PANDAS_CI: 1
17+
PYTEST_TARGET: pandas
18+
PYTEST_WORKERS: auto
19+
PATTERN: "not slow and not db and not network and not single_cpu"
20+
21+
22+
jobs:
23+
pytest:
24+
runs-on: windows-latest
25+
defaults:
26+
run:
27+
shell: bash -el {0}
28+
timeout-minutes: 90
29+
strategy:
30+
matrix:
31+
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
32+
fail-fast: false
33+
concurrency:
34+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
35+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-windows
36+
cancel-in-progress: true
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Install Dependencies
45+
uses: conda-incubator/[email protected]
46+
with:
47+
mamba-version: "*"
48+
channels: conda-forge
49+
activate-environment: pandas-dev
50+
channel-priority: strict
51+
environment-file: ci/deps/${{ matrix.env_file }}
52+
use-only-tar-bz2: true
53+
54+
- name: Build Pandas
55+
uses: ./.github/actions/build_pandas
56+
57+
- name: Test
58+
run: ci/run_tests.sh
59+
60+
- name: Build Version
61+
run: conda list
62+
63+
- name: Publish test results
64+
uses: actions/upload-artifact@v3
65+
with:
66+
name: Test results
67+
path: test-data.xml
68+
if: failure()
69+
70+
- name: Upload coverage to Codecov
71+
uses: codecov/codecov-action@v2
72+
with:
73+
flags: unittests
74+
name: codecov-pandas
75+
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ repos:
8989
types: [python]
9090
stages: [manual]
9191
# note: keep version in sync with .github/workflows/code-checks.yml
92-
additional_dependencies: ['[email protected].230']
92+
additional_dependencies: ['[email protected].245']
9393
- repo: local
9494
hooks:
9595
- id: flake8-rst

asv_bench/benchmarks/tslibs/fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ class TimeGetStartEndField:
6666

6767
def setup(self, size, side, period, freqstr, month_kw):
6868
arr = np.random.randint(0, 10, size=size, dtype="i8")
69-
self.dt64data = arr.view("M8[ns]")
69+
self.i8data = arr
7070

7171
self.attrname = f"is_{period}_{side}"
7272

7373
def time_get_start_end_field(self, size, side, period, freqstr, month_kw):
74-
get_start_end_field(self.dt64data, self.attrname, freqstr, month_kw=month_kw)
74+
get_start_end_field(self.i8data, self.attrname, freqstr, month_kw=month_kw)

azure-pipelines.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ jobs:
2727
name: macOS
2828
vmImage: macOS-10.15
2929

30-
- template: ci/azure/windows.yml
31-
parameters:
32-
name: Windows
33-
vmImage: windows-2019
34-
3530
- job: py38_32bit
3631
pool:
3732
vmImage: ubuntu-18.04

ci/azure/windows.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

doc/source/getting_started/intro_tutorials/includes/titanic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ consists of the following data columns:
2626
.. raw:: html
2727

2828
</p>
29-
<a href="https://github.com/pandas-dev/pandas/tree/main/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
29+
<a href="https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
3030
</div>
3131
</div>

doc/source/user_guide/cookbook.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ Unlike agg, apply's callable is passed a sub-DataFrame which gives you access to
511511
512512
def replace(g):
513513
mask = g < 0
514-
return g.where(mask, g[~mask].mean())
514+
return g.where(~mask, g[~mask].mean())
515515
516516
gb.transform(replace)
517517

doc/source/whatsnew/v1.5.0.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,31 @@ as seen in the following example.
100100
1 2021-01-02 08:00:00 4
101101
2 2021-01-02 16:00:00 5
102102
103+
.. _whatsnew_150.enhancements.tar:
104+
105+
Reading directly from TAR archives
106+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107+
108+
I/O methods like :func:`read_csv` or :meth:`DataFrame.to_json` now allow reading and writing
109+
directly on TAR archives (:issue:`44787`).
110+
111+
.. code-block:: python
112+
113+
df = pd.read_csv("./movement.tar.gz")
114+
# ...
115+
df.to_csv("./out.tar.gz")
116+
117+
This supports ``.tar``, ``.tar.gz``, ``.tar.bz`` and ``.tar.xz2`` archives.
118+
The used compression method is inferred from the filename.
119+
If the compression method cannot be inferred, use the ``compression`` argument:
120+
121+
.. code-block:: python
122+
123+
df = pd.read_csv(some_file_obj, compression={"method": "tar", "mode": "r:gz"}) # noqa F821
124+
125+
(``mode`` being one of ``tarfile.open``'s modes: https://docs.python.org/3/library/tarfile.html#tarfile.open)
126+
127+
103128
.. _whatsnew_150.enhancements.other:
104129

105130
Other enhancements

pandas/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
__docformat__ = "restructuredtext"
44

55
# Let users know if they're missing any of our hard dependencies
6-
hard_dependencies = ("numpy", "pytz", "dateutil")
7-
missing_dependencies = []
6+
_hard_dependencies = ("numpy", "pytz", "dateutil")
7+
_missing_dependencies = []
88

9-
for dependency in hard_dependencies:
9+
for _dependency in _hard_dependencies:
1010
try:
11-
__import__(dependency)
12-
except ImportError as e:
13-
missing_dependencies.append(f"{dependency}: {e}")
11+
__import__(_dependency)
12+
except ImportError as _e:
13+
_missing_dependencies.append(f"{_dependency}: {_e}")
1414

15-
if missing_dependencies:
15+
if _missing_dependencies:
1616
raise ImportError(
17-
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
17+
"Unable to import required dependencies:\n" + "\n".join(_missing_dependencies)
1818
)
19-
del hard_dependencies, dependency, missing_dependencies
19+
del _hard_dependencies, _dependency, _missing_dependencies
2020

2121
# numpy compat
2222
from pandas.compat import is_numpy_dev as _is_numpy_dev
2323

2424
try:
2525
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
26-
except ImportError as err: # pragma: no cover
27-
module = err.name
26+
except ImportError as _err: # pragma: no cover
27+
_module = _err.name
2828
raise ImportError(
29-
f"C extension: {module} not built. If you want to import "
29+
f"C extension: {_module} not built. If you want to import "
3030
"pandas from the source directory, you may need to run "
3131
"'python setup.py build_ext --force' to build the C extensions first."
32-
) from err
32+
) from _err
3333
else:
3434
del _tslib, _lib, _hashtable
3535

0 commit comments

Comments
 (0)