Skip to content

Commit dd73fc7

Browse files
jbrockmendelproost
authored andcommitted
DEPR: enforce deprecations in core.internals (pandas-dev#29723)
1 parent f3800e9 commit dd73fc7

File tree

11 files changed

+78
-38
lines changed

11 files changed

+78
-38
lines changed

ci/deps/azure-windows-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
# pandas dependencies
1616
- blosc
1717
- bottleneck
18-
- fastparquet>=0.2.1
18+
- fastparquet>=0.3.2
1919
- matplotlib=3.0.2
2020
- numexpr
2121
- numpy=1.15.*

ci/deps/travis-36-cov.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- botocore>=1.11
1818
- cython>=0.29.13
1919
- dask
20-
- fastparquet>=0.2.1
20+
- fastparquet>=0.3.2
2121
- gcsfs
2222
- geopandas
2323
- html5lib

ci/deps/travis-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- beautifulsoup4
1616
- blosc=1.14.3
1717
- python-blosc
18-
- fastparquet=0.2.1
18+
- fastparquet=0.3.2
1919
- gcsfs=0.2.2
2020
- html5lib
2121
- ipython

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ SQLAlchemy 1.1.4 SQL support for databases other tha
250250
SciPy 0.19.0 Miscellaneous statistical functions
251251
XLsxWriter 0.9.8 Excel writing
252252
blosc Compression for msgpack
253-
fastparquet 0.2.1 Parquet reading / writing
253+
fastparquet 0.3.2 Parquet reading / writing
254254
gcsfs 0.2.2 Google Cloud Storage access
255255
html5lib HTML parser for read_html (see :ref:`note <optional_html>`)
256256
lxml 3.8.0 HTML parser for read_html (see :ref:`note <optional_html>`)

doc/source/whatsnew/v1.0.0.rst

+67
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,71 @@ The following methods now also correctly output values for unobserved categories
235235
df.groupby(["cat_1", "cat_2"], observed=False)["value"].count()
236236
237237
238+
.. _whatsnew_1000.api_breaking.deps:
239+
240+
Increased minimum versions for dependencies
241+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
242+
243+
Some minimum supported versions of dependencies were updated (:issue:`29723`).
244+
If installed, we now require:
245+
246+
+-----------------+-----------------+----------+
247+
| Package | Minimum Version | Required |
248+
+=================+=================+==========+
249+
| numpy | 1.13.3 | X |
250+
+-----------------+-----------------+----------+
251+
| pytz | 2015.4 | X |
252+
+-----------------+-----------------+----------+
253+
| python-dateutil | 2.6.1 | X |
254+
+-----------------+-----------------+----------+
255+
| bottleneck | 1.2.1 | |
256+
+-----------------+-----------------+----------+
257+
| numexpr | 2.6.2 | |
258+
+-----------------+-----------------+----------+
259+
| pytest (dev) | 4.0.2 | |
260+
+-----------------+-----------------+----------+
261+
262+
For `optional libraries <https://dev.pandas.io/docs/install.html#dependencies>`_ the general recommendation is to use the latest version.
263+
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.
264+
Optional libraries below the lowest tested version may still work, but are not considered supported.
265+
266+
+-----------------+-----------------+
267+
| Package | Minimum Version |
268+
+=================+=================+
269+
| beautifulsoup4 | 4.6.0 |
270+
+-----------------+-----------------+
271+
| fastparquet | 0.3.2 |
272+
+-----------------+-----------------+
273+
| gcsfs | 0.2.2 |
274+
+-----------------+-----------------+
275+
| lxml | 3.8.0 |
276+
+-----------------+-----------------+
277+
| matplotlib | 2.2.2 |
278+
+-----------------+-----------------+
279+
| openpyxl | 2.4.8 |
280+
+-----------------+-----------------+
281+
| pyarrow | 0.9.0 |
282+
+-----------------+-----------------+
283+
| pymysql | 0.7.1 |
284+
+-----------------+-----------------+
285+
| pytables | 3.4.2 |
286+
+-----------------+-----------------+
287+
| scipy | 0.19.0 |
288+
+-----------------+-----------------+
289+
| sqlalchemy | 1.1.4 |
290+
+-----------------+-----------------+
291+
| xarray | 0.8.2 |
292+
+-----------------+-----------------+
293+
| xlrd | 1.1.0 |
294+
+-----------------+-----------------+
295+
| xlsxwriter | 0.9.8 |
296+
+-----------------+-----------------+
297+
| xlwt | 1.2.0 |
298+
+-----------------+-----------------+
299+
300+
See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for more.
301+
302+
238303
.. _whatsnew_1000.api.other:
239304

240305
Other API changes
@@ -321,6 +386,8 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
321386
- Removed :meth:`DataFrame.as_blocks`, :meth:`Series.as_blocks`, `DataFrame.blocks`, :meth:`Series.blocks` (:issue:`17656`)
322387
- :meth:`pandas.Series.str.cat` now defaults to aligning ``others``, using ``join='left'`` (:issue:`27611`)
323388
- :meth:`pandas.Series.str.cat` does not accept list-likes *within* list-likes anymore (:issue:`27611`)
389+
- :func:`core.internals.blocks.make_block` no longer accepts the "fastpath" keyword(:issue:`19265`)
390+
- :meth:`Block.make_block_same_class` no longer accepts the "dtype" keyword(:issue:`19434`)
324391
- Removed the previously deprecated :meth:`ExtensionArray._formatting_values`. Use :attr:`ExtensionArray._formatter` instead. (:issue:`23601`)
325392
- Removed support for legacy HDF5 formats (:issue:`29787`)
326393
- :func:`read_excel` removed support for "skip_footer" argument, use "skipfooter" instead (:issue:`18836`)

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dependencies:
7575

7676
# optional for io
7777
- beautifulsoup4>=4.6.0 # pandas.read_html
78-
- fastparquet>=0.2.1 # pandas.read_parquet, DataFrame.to_parquet
78+
- fastparquet>=0.3.2 # pandas.read_parquet, DataFrame.to_parquet
7979
- html5lib # pandas.read_html
8080
- lxml # pandas.read_html
8181
- openpyxl # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile

pandas/compat/_optional.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
VERSIONS = {
99
"bs4": "4.6.0",
1010
"bottleneck": "1.2.1",
11-
"fastparquet": "0.2.1",
11+
"fastparquet": "0.3.2",
1212
"gcsfs": "0.2.2",
1313
"lxml.etree": "3.8.0",
1414
"matplotlib": "2.2.2",

pandas/core/internals/blocks.py

+3-17
Original file line numberDiff line numberDiff line change
@@ -251,21 +251,13 @@ def make_block(self, values, placement=None):
251251

252252
return make_block(values, placement=placement, ndim=self.ndim)
253253

254-
def make_block_same_class(self, values, placement=None, ndim=None, dtype=None):
254+
def make_block_same_class(self, values, placement=None, ndim=None):
255255
""" Wrap given values in a block of same type as self. """
256-
if dtype is not None:
257-
# issue 19431 fastparquet is passing this
258-
warnings.warn(
259-
"dtype argument is deprecated, will be removed in a future release.",
260-
FutureWarning,
261-
)
262256
if placement is None:
263257
placement = self.mgr_locs
264258
if ndim is None:
265259
ndim = self.ndim
266-
return make_block(
267-
values, placement=placement, ndim=ndim, klass=self.__class__, dtype=dtype
268-
)
260+
return make_block(values, placement=placement, ndim=ndim, klass=self.__class__)
269261

270262
def __repr__(self) -> str:
271263
# don't want to print out all of the items here
@@ -3001,7 +2993,7 @@ def get_block_type(values, dtype=None):
30012993
return cls
30022994

30032995

3004-
def make_block(values, placement, klass=None, ndim=None, dtype=None, fastpath=None):
2996+
def make_block(values, placement, klass=None, ndim=None, dtype=None):
30052997
# Ensure that we don't allow PandasArray / PandasDtype in internals.
30062998
# For now, blocks should be backed by ndarrays when possible.
30072999
if isinstance(values, ABCPandasArray):
@@ -3012,12 +3004,6 @@ def make_block(values, placement, klass=None, ndim=None, dtype=None, fastpath=No
30123004
if isinstance(dtype, PandasDtype):
30133005
dtype = dtype.numpy_dtype
30143006

3015-
if fastpath is not None:
3016-
# GH#19265 pyarrow is passing this
3017-
warnings.warn(
3018-
"fastpath argument is deprecated, will be removed in a future release.",
3019-
FutureWarning,
3020-
)
30213007
if klass is None:
30223008
dtype = dtype or values.dtype
30233009
klass = get_block_type(values, dtype)

pandas/tests/internals/test_internals.py

-13
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,6 @@ def test_delete(self):
308308
with pytest.raises(Exception):
309309
newb.delete(3)
310310

311-
def test_make_block_same_class(self):
312-
# issue 19431
313-
block = create_block("M8[ns, US/Eastern]", [3])
314-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
315-
block.make_block_same_class(block.values, dtype=block.values.dtype)
316-
317311

318312
class TestDatetimeBlock:
319313
def test_can_hold_element(self):
@@ -1255,13 +1249,6 @@ def test_holder(typestr, holder):
12551249
assert blk._holder is holder
12561250

12571251

1258-
def test_deprecated_fastpath():
1259-
# GH#19265
1260-
values = np.random.rand(3, 3)
1261-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
1262-
make_block(values, placement=np.arange(3), fastpath=True)
1263-
1264-
12651252
def test_validate_ndim():
12661253
values = np.array([1.0, 2.0])
12671254
placement = slice(2)

pandas/tests/io/test_parquet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def test_additional_extension_arrays(self, pa):
531531

532532

533533
class TestParquetFastParquet(Base):
534-
@td.skip_if_no("fastparquet", min_version="0.2.1")
534+
@td.skip_if_no("fastparquet", min_version="0.3.2")
535535
def test_basic(self, fp, df_full):
536536
df = df_full
537537

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ matplotlib>=2.2.2
4848
numexpr>=2.6.8
4949
scipy>=1.1
5050
beautifulsoup4>=4.6.0
51-
fastparquet>=0.2.1
51+
fastparquet>=0.3.2
5252
html5lib
5353
lxml
5454
openpyxl

0 commit comments

Comments
 (0)