code: def test_bad_last_stage(self, stages):
      # Will fail since the last stage is not an estimator
      with pytest.raises(TypeError) as ve:
          Pipeline(stages)
  
      assert "Last step of Pipeline should be" in pytest_error_str(ve)
  
imports: from pmdarima.compat.pytest import pytest_error_str
  from pmdarima.model_selection import train_test_split
  from pmdarima.pipeline import Pipeline, _warn_for_deprecated
  from pmdarima.preprocessing import BoxCoxEndogTransformer, FourierFeaturizer, DateFeaturizer, LogEndogTransformer
  from pmdarima.arima import ARIMA, AutoARIMA
  from pmdarima.datasets import load_wineind
  from pmdarima.datasets._base import load_date_example
  import numpy
  from numpy.testing import assert_array_almost_equal
  import pytest
label_desc: Use image node_id 5 for calling the TestIllegal obj's underlying member method code with example usage: obj.test_bad_last_stage(stages) without return types