Remove unused fastpath kwarg from Blocks
State: closed

The `fastpath` kwarg in `Block.__init__` must be vestigial or something.  It isn't used anywhere in the blocks themselves.  This PR removes the unused kwarg.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Deprecate
description: Functionality to remove in pandas
name: Clean

Comments:
this is used in singleblock construction. not sure if you took those out. this can prob be removed, but please do a perf run with affinity to check.
Did you try removing `**kwargs` from all the block subclasses? I'm curious if anything breaks, but haven't had a chance yet.
> Did you try removing **kwargs from all the block subclasses? I'm curious if anything breaks, but haven't had a chance yet.

@TomAugspurger I'll give it a shot.

> this is used in singleblock construction. not sure if you took those out. this can prob be removed, but please do a perf run with affinity to check.

@jreback where is it used?  Totally plausible that I missed something.  For the asv, is there any particular subset you have in mind, or kitchen-sink?
appveyor breakage is from downstream: pyarrow passes `fastpath` to `internals.make_block`.  I can put the kwarg back in there until it can be removed downstream I guess.
@TomAugspurger Removed the `**kwargs` from the `__init__` methods, added in `ndim=None` for a few for uniformity.  Didn't break any tests.
Per usual, looks indistinguishable from noise.

asv grepping for frame:

```
taskset 2 asv continuous -E virtualenv -f 1.1 master HEAD -b frame
[...]
    before     after       ratio
  [4ebdc50f] [4ca06ee8]
+   26.15ms      1.67s     63.77  frame_methods.Reindex.time_reindex_both_axes
+   54.40ms      2.57s     47.19  frame_methods.Count.time_count_level_mixed_dtypes_multi(1)
+  139.39ms      1.31s      9.39  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('any', 1)
+  198.04ms      1.82s      9.18  plotting.Plotting.time_frame_plot
+   16.89ms   104.62ms      6.20  indexing.MultiIndexing.time_frame_ix
+  104.33ms   643.40ms      6.17  reindex.DropDuplicates.time_frame_drop_dups_int(True)
+   22.04ms   111.53ms      5.06  reindex.DropDuplicates.time_frame_drop_dups_int(False)
+   16.43ms    53.41ms      3.25  join_merge.Join.time_join_dataframe_index_single_key_bigger(False)
+   15.58ms    46.06ms      2.96  join_merge.Join.time_join_dataframe_index_single_key_small(True)
+   18.61ms    53.04ms      2.85  join_merge.Join.time_join_dataframe_index_single_key_bigger(True)
+     1.20s      3.35s      2.79  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('all', 1)
+   18.60ms    51.71ms      2.78  join_merge.Join.time_join_dataframe_index_shuffle_key_bigger_sort(True)
+  785.79ms      2.04s      2.59  frame_methods.Reindex.time_reindex_both_axes_ix
+   15.99ms    36.47ms      2.28  join_merge.Join.time_join_dataframe_index_shuffle_key_bigger_sort(False)
+   15.54ms    29.40ms      1.89  join_merge.Join.time_join_dataframe_index_single_key_small(False)
+   71.24ms   117.31ms      1.65  frame_methods.MaskBool.time_frame_mask_bools
+   49.63ms    77.82ms      1.57  frame_methods.MaskBool.time_frame_mask_floats
+    1.53ms     2.25ms      1.47  reshape.Melt.time_melt_dataframe
+  119.18ms   157.06ms      1.32  binary_ops.Ops2.time_frame_int_mod
+  214.52ms   266.75ms      1.24  frame_methods.Interpolate.time_interpolate(None)
+    9.27ms    11.13ms      1.20  reindex.DropDuplicates.time_frame_drop_dups_na(False)
+     1.56s      1.86s      1.20  frame_methods.SortValues.time_frame_sort_values(True)
+  520.82ms   590.52ms      1.13  binary_ops.Ops.time_frame_multi_and(True, 1)
+    2.62ms     2.90ms      1.11  reindex.DropDuplicates.time_frame_drop_dups_na(True)
+   62.74μs    69.05μs      1.10  frame_ctor.FromNDArray.time_frame_from_ndarray
-     2.05s      1.84s      0.90  frame_methods.Nunique.time_frame_nunique
-    2.36ms     2.11ms      0.89  binary_ops.Ops2.time_frame_float_div_by_zero
-  576.91ms   515.64ms      0.89  binary_ops.Ops.time_frame_multi_and(False, 'default')
-    6.36ms     5.55ms      0.87  frame_methods.Reindex.time_reindex_upcast
-     5.53s      2.61s      0.47  frame_methods.Reindex.time_reindex_axis1
-  377.66ms    70.19ms      0.19  frame_methods.Dropna.time_dropna('any', 1)
-  394.27ms    70.29ms      0.18  frame_methods.Interpolate.time_interpolate('infer')
-   50.42ms     4.15ms      0.08  frame_methods.Reindex.time_reindex_axis0
-  423.53ms    32.99ms      0.08  binary_ops.Ops2.time_frame_float_div
-  327.20ms    23.53ms      0.07  frame_methods.Dropna.time_dropna('any', 0)

taskset 2 asv continuous -E virtualenv -f 1.1 master HEAD -b frame
[...]
    before     after       ratio
  [4ebdc50f] [4ca06ee8]
+  109.89ms      1.50s     13.64  frame_methods.Duplicated.time_frame_duplicated
+   44.16ms   312.46ms      7.08  frame_methods.Interpolate.time_interpolate(None)
+   10.58ms    69.46ms      6.56  frame_methods.MaskBool.time_frame_mask_bools
+   71.69ms   454.94ms      6.35  frame_methods.Interpolate.time_interpolate('infer')
+  540.53ms      3.32s      6.15  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('all', 1)
+  253.84ms      1.38s      5.42  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('any', 0)
+  289.15ms      1.38s      4.77  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('any', 1)
+   39.38ms   144.49ms      3.67  frame_methods.Equals.time_frame_object_equal
+  558.51ms      1.48s      2.64  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('all', 0)
+  923.58ms      2.06s      2.24  frame_methods.Nunique.time_frame_nunique
+   18.85ms    29.84ms      1.58  join_merge.Join.time_join_dataframe_index_multi(True)
+   73.49ms   102.31ms      1.39  frame_methods.MaskBool.time_frame_mask_floats
+  108.68ms   148.64ms      1.37  reindex.DropDuplicates.time_frame_drop_dups_int(True)
+   16.19ms    21.75ms      1.34  join_merge.Join.time_join_dataframe_index_shuffle_key_bigger_sort(False)
+   20.22ms    27.01ms      1.34  binary_ops.Ops2.time_frame_int_div_by_zero
+   13.14ms    17.42ms      1.33  indexing.MultiIndexing.time_frame_ix
+   15.98ms    20.88ms      1.31  join_merge.Join.time_join_dataframe_index_single_key_small(True)
+   15.45ms    19.93ms      1.29  join_merge.Join.time_join_dataframe_index_single_key_small(False)
+  206.67ms   266.15ms      1.29  plotting.Plotting.time_frame_plot
+   16.60ms    20.93ms      1.26  join_merge.Join.time_join_dataframe_index_single_key_bigger(False)
+   18.71ms    23.00ms      1.23  join_merge.Join.time_join_dataframe_index_shuffle_key_bigger_sort(True)
+   18.92ms    23.04ms      1.22  join_merge.Join.time_join_dataframe_index_single_key_bigger(True)
-     1.91s      1.70s      0.89  frame_methods.Reindex.time_reindex_both_axes
-   34.92ms    29.02ms      0.83  binary_ops.Ops2.time_frame_int_mod
-  131.12ms   108.27ms      0.83  binary_ops.Ops.time_frame_multi_and(False, 1)
-  115.51ms    93.27ms      0.81  binary_ops.Ops2.time_frame_float_div
-    6.22ms     4.88ms      0.78  frame_methods.Reindex.time_reindex_upcast
-  149.49ms   108.57ms      0.73  binary_ops.Ops.time_frame_multi_and(True, 1)
-  162.29ms   114.51ms      0.71  binary_ops.Ops.time_frame_multi_and(False, 'default')
-     5.56s      3.70s      0.66  frame_methods.Reindex.time_reindex_axis1
-  313.34ms   170.31ms      0.54  binary_ops.Ops.time_frame_multi_and(True, 'default')
-     1.59s    26.82ms      0.02  frame_methods.Reindex.time_reindex_both_axes_ix

taskset 2 asv continuous -E virtualenv -f 1.1 master HEAD -b frame
[...]
    before     after       ratio
  [4ebdc50f] [4ca06ee8]
+  349.10μs    73.83ms    211.49  indexing.MultiIndexing.time_frame_ix
+    8.56ms   102.31ms     11.95  frame_methods.MaskBool.time_frame_mask_floats
+   29.58ms    84.62ms      2.86  frame_methods.MaskBool.time_frame_mask_bools
+  422.53ms   852.40ms      2.02  frame_methods.Shift.time_shift(0)
+   22.75ms    43.05ms      1.89  join_merge.Join.time_join_dataframe_index_shuffle_key_bigger_sort(False)
+    4.85ms     9.02ms      1.86  frame_methods.Reindex.time_reindex_axis0
+     1.61s      1.96s      1.22  frame_methods.Reindex.time_reindex_both_axes
+  799.89ms   894.05ms      1.12  frame_methods.Shift.time_shift(1)
-    6.56ms     5.54ms      0.84  frame_methods.Reindex.time_reindex_upcast
-   60.23ms    32.42ms      0.54  join_merge.Join.time_join_dataframe_index_multi(True)
-     2.12s      1.07s      0.51  frame_methods.Nunique.time_frame_nunique
-  117.01ms    35.19ms      0.30  binary_ops.Ops2.time_frame_int_mod
-  576.67ms   171.18ms      0.30  binary_ops.Ops.time_frame_multi_and(True, 'default')
-  308.35ms    89.35ms      0.29  binary_ops.Ops2.time_frame_float_floor_by_zero
-  164.20ms    39.42ms      0.24  frame_methods.Equals.time_frame_object_equal
-  361.96ms    86.84ms      0.24  binary_ops.Ops2.time_frame_float_div
-     1.29s   280.17ms      0.22  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('any', 0)
-     1.23s   260.00ms      0.21  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('any', 1)
-  327.24ms    64.63ms      0.20  frame_methods.Dropna.time_dropna('any', 0)
-  585.94ms   114.43ms      0.20  binary_ops.Ops.time_frame_multi_and(True, 1)
-  531.30ms   102.23ms      0.19  binary_ops.Ops.time_frame_multi_and(False, 1)
-     3.16s   557.11ms      0.18  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('all', 0)
-  628.65ms   109.94ms      0.17  binary_ops.Ops.time_frame_multi_and(False, 'default')
-     3.18s   555.30ms      0.17  frame_methods.Dropna.time_dropna_axis_mixed_dtypes('all', 1)
-  378.06ms    65.60ms      0.17  frame_methods.Dropna.time_dropna('any', 1)
-  159.63ms    26.72ms      0.17  binary_ops.Ops2.time_frame_int_div_by_zero
-     2.16s   344.96ms      0.16  frame_methods.Count.time_count_level_multi(1)
-     2.06s   326.21ms      0.16  frame_methods.Dropna.time_dropna('all', 1)
-     1.95s   301.81ms      0.15  frame_methods.Dropna.time_dropna('all', 0)
-     2.21s   331.76ms      0.15  frame_methods.Count.time_count_level_mixed_dtypes_multi(1)
-     2.26s   329.46ms      0.15  frame_methods.Count.time_count_level_multi(0)
-  300.36ms    43.22ms      0.14  frame_methods.Interpolate.time_interpolate(None)
-     2.58s   342.52ms      0.13  frame_methods.Count.time_count_level_mixed_dtypes_multi(0)
-     1.49s   191.88ms      0.13  frame_methods.Duplicated.time_frame_duplicated
```

asv grepping for series:
```
taskset 2 asv continuous -E virtualenv -f 1.1 master HEAD -b series
[...]
    before     after       ratio
  [4ebdc50f] [4ca06ee8]
+   11.16ms   270.31ms     24.22  binary_ops.Timeseries.time_timestamp_ops_diff('US/Eastern')
+  186.46ms      1.92s     10.27  plotting.Plotting.time_series_plot
+  202.27ms      1.37s      6.79  join_merge.Align.time_series_align_int64_index
+    1.64ms     9.10ms      5.56  timeseries.ResampleSeries.time_resample('period', '1D', 'mean')
+   12.23ms    57.95ms      4.74  indexing.MultiIndexing.time_series_ix
+   30.14ms   120.76ms      4.01  timeseries.Factorize.time_factorize('Asia/Tokyo')
+  131.90ms   473.24ms      3.59  join_merge.Align.time_series_align_left_monotonic
+   28.13ms    81.35ms      2.89  timeseries.Factorize.time_factorize(None)
+    2.04ms     5.53ms      2.71  timeseries.ResampleSeries.time_resample('datetime', '5min', 'mean')
+    1.64ms     4.22ms      2.57  timeseries.ResampleSeries.time_resample('datetime', '1D', 'mean')
+   19.12ms    23.78ms      1.24  join_merge.Concat.time_concat_series(0)
+  378.37ms   429.51ms      1.14  binary_ops.Timeseries.time_timestamp_ops_diff(None)
+  450.50ms   502.79ms      1.12  timeseries.ToDatetimeFormat.time_no_exact
+    2.38ms     2.66ms      1.11  timeseries.ResampleSeries.time_resample('period', '5min', 'ohlc')
+  310.25ms   343.30ms      1.11  groupby.Groups.time_series_groups('object_large')
-    4.08ms     3.67ms      0.90  timeseries.ToDatetimeISO8601.time_iso8601_format_no_sep
-    1.64ms     1.44ms      0.88  timeseries.ToDatetimeCache.time_dup_string_dates_and_format(False)
-  465.86ms   325.62ms      0.70  binary_ops.Timeseries.time_timestamp_ops_diff_with_shift('US/Eastern')
-  179.21ms   121.12ms      0.68  reshape.Pivot.time_reshape_pivot_time_series
-    8.99ms     1.97ms      0.22  timeseries.ResampleSeries.time_resample('period', '5min', 'mean')

taskset 2 asv continuous -E virtualenv -f 1.1 master HEAD -b series
[...]
    before     after       ratio
  [4ebdc50f] [4ca06ee8]
+   85.00ms   105.82ms      1.24  join_merge.Concat.time_concat_series(1)
+    6.07ms     7.53ms      1.24  timeseries.AsOf.time_asof('DataFrame')
+    5.95ms     7.36ms      1.24  timeseries.AsOf.time_asof_nan('DataFrame')
+   57.58ms    69.33ms      1.20  join_merge.Concat.time_concat_series(0)
+  549.45μs   613.05μs      1.12  timeseries.DatetimeIndex.time_to_time('dst')
+  376.91ms   416.88ms      1.11  binary_ops.Timeseries.time_timestamp_ops_diff_with_shift('US/Eastern')
+    4.26μs     4.71μs      1.11  timeseries.DatetimeIndex.time_get('tz_naive')
-  484.37ms   435.51ms      0.90  join_merge.Align.time_series_align_left_monotonic
-     1.47s      1.27s      0.86  reshape.Pivot.time_reshape_pivot_time_series
-  309.61ms   261.52ms      0.84  binary_ops.Timeseries.time_timestamp_ops_diff('US/Eastern')
-  385.45ms   151.86ms      0.39  binary_ops.Timeseries.time_timestamp_ops_diff_with_shift(None)
-   81.86ms     8.10ms      0.10  timeseries.Factorize.time_factorize(None)
-     1.17s    87.00ms      0.07  join_merge.Align.time_series_align_int64_index

taskset 2 asv continuous -E virtualenv -f 1.1 master HEAD -b series
[...]
    before     after       ratio
  [4ebdc50f] [4ca06ee8]
+  181.18ms      1.72s      9.51  plotting.Plotting.time_series_plot
+   21.33ms   137.98ms      6.47  timeseries.Factorize.time_factorize(None)
+   28.85ms   117.52ms      4.07  timeseries.Factorize.time_factorize('Asia/Tokyo')
+   27.14ms   104.66ms      3.86  indexing.MultiIndexing.time_series_ix
+  131.48ms   487.58ms      3.71  join_merge.Align.time_series_align_left_monotonic
+  190.25ms   666.74ms      3.50  join_merge.Align.time_series_align_int64_index
+   19.16ms    55.18ms      2.88  join_merge.Concat.time_concat_series(0)
+  190.71ms   418.05ms      2.19  binary_ops.Timeseries.time_timestamp_ops_diff(None)
+  155.73ms   181.73ms      1.17  timeseries.DatetimeIndex.time_to_pydatetime('tz_aware')
+    2.83ms     3.18ms      1.13  ctors.SeriesConstructors.time_series_constructor(<function <lambda> at 0x7f49510925f0>, True)
+    4.29μs     4.74μs      1.11  timeseries.DatetimeIndex.time_get('tz_naive')
-   85.65μs    76.79μs      0.90  frame_ctor.FromSeries.time_mi_series
-    4.13ms     3.68ms      0.89  timeseries.ToDatetimeISO8601.time_iso8601_format_no_sep
-  514.38ms   445.02ms      0.87  timeseries.ToDatetimeFormat.time_exact
-  177.96ms   120.30ms      0.68  reshape.Pivot.time_reshape_pivot_time_series
-    6.06ms     2.40ms      0.40  timeseries.ResampleSeries.time_resample('datetime', '5min', 'ohlc')
-    9.67ms     2.05ms      0.21  timeseries.ResampleSeries.time_resample('period', '1D', 'ohlc')
-    9.03ms     1.74ms      0.19  timeseries.ResampleSeries.time_resample('period', '1D', 'mean')
```
@jbrockmendel these asv's are not stable from you. are you sure you are running with affinity? 
> these asv's are not stable from you. are you sure you are running with affinity?

@jreback I'm pretty sure that's what the "taskset" is doing.  Is there a better way to do that?

FWIW when I tried to get dateutil to use asv we found that I wasn't the only one getting wildly unreliable results.

(I also made a brief push to get ASV to a) stagger benchmarks so as to smooth out background noise and b) aggregate stats across runs to get bigger sample sizes, but that went nowhere)
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=h1) Report
> Merging [#19265](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/4086e420c8c7a5f72fb9090a7d2d97045cf443bb?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `93.33%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/19265/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #19265      +/-   ##
==========================================
- Coverage   91.54%   91.53%   -0.02%     
==========================================
  Files         148      150       +2     
  Lines       48870    48739     -131     
==========================================
- Hits        44737    44612     -125     
+ Misses       4133     4127       -6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.9% <93.33%> (-0.02%)` | :arrow_down: |
| #single | `41.73% <60%> (+0.06%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `94.53% <93.33%> (ø)` | :arrow_up: |
| [pandas/io/parquet.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnF1ZXQucHk=) | `52.29% <0%> (-19.27%)` | :arrow_down: |
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.45% <0%> (ø)` | :arrow_up: |
| [pandas/compat/pickle\_compat.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9waWNrbGVfY29tcGF0LnB5) | `75.6% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.78% <0%> (ø)` | |
| [pandas/core/arrays/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL19faW5pdF9fLnB5) | `100% <0%> (ø)` | |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `93.11% <0%> (+0.93%)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `66.95% <0%> (+1.73%)` | :arrow_up: |
| ... and [1 more](https://codecov.io/gh/pandas-dev/pandas/pull/19265/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=footer). Last update [4086e42...1ee7940](https://codecov.io/gh/pandas-dev/pandas/pull/19265?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

needs a rebase
seems ok. just waiting on travis.
Looks like Travis is OK except OSX cancelled.
I don't think this deprecation ever went into the WhatsNew.  Is there a ballpark timeframe for when to remove it?  IIRC the blocker was getting fastparquet to stop using it