class_docstr: Test common dtype coercion rules between concat and append.
class_docstr_tok: ["Test","common","dtype","coercion","rules","between","concat","and","append","."]
code: def test_concat_categorical_empty(self):
      # GH 13524
  
      s1 = Series([], dtype="category")
      s2 = Series([1, 2], dtype="category")
  
      msg = "The behavior of array concatenation with empty entries is deprecated"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          tm.assert_series_equal(
              pd.concat([s1, s2], ignore_index=True), s2
          )
          tm.assert_series_equal(s1._append(s2, ignore_index=True), s2)
  
      with tm.assert_produces_warning(FutureWarning, match=msg):
          tm.assert_series_equal(
              pd.concat([s2, s1], ignore_index=True), s2
          )
          tm.assert_series_equal(s2._append(s1, ignore_index=True), s2)
  
      s1 = Series([], dtype="category")
      s2 = Series([], dtype="category")
  
      tm.assert_series_equal(pd.concat([s1, s2], ignore_index=True), s2)
      tm.assert_series_equal(s1._append(s2, ignore_index=True), s2)
  
      s1 = Series([], dtype="category")
      s2 = Series([], dtype="object")
  
      # different dtype => not-category
      tm.assert_series_equal(pd.concat([s1, s2], ignore_index=True), s2)
      tm.assert_series_equal(s1._append(s2, ignore_index=True), s2)
      tm.assert_series_equal(pd.concat([s2, s1], ignore_index=True), s2)
      tm.assert_series_equal(s2._append(s1, ignore_index=True), s2)
  
      s1 = Series([], dtype="category")
      s2 = Series([np.nan, np.nan])
  
      # empty Series is ignored
      exp = Series([np.nan, np.nan])
      with tm.assert_produces_warning(FutureWarning, match=msg):
          tm.assert_series_equal(
              pd.concat([s1, s2], ignore_index=True), exp
          )
          tm.assert_series_equal(s1._append(s2, ignore_index=True), exp)
  
      with tm.assert_produces_warning(FutureWarning, match=msg):
          tm.assert_series_equal(
              pd.concat([s2, s1], ignore_index=True), exp
          )
          tm.assert_series_equal(s2._append(s1, ignore_index=True), exp)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import Categorical, DataFrame, Index, Series
  import pandas._testing
label_desc: Use image node_id 18 for calling the TestConcatAppendCommon obj's underlying member method code with example usage: obj.test_concat_categorical_empty() without return types