'Tests the following:
1) Forward filling replaces missing values correctly for the data
types supported in pipeline.
2) We don\'t forward fill when the missing value is the actual value
we got for a date in the case of int/bool columns.
3) We get the correct type of missing value in the output.
input (self.df):
asof_date bool_value   dt_value  float_value  int_value  sid
0 2014-01-01       True 2011-01-01            0          1   65
1 2014-01-03       True 2011-01-02            1          2   66
2 2014-01-01       True 2011-01-03            2          3   67
3 2014-01-02      False        NaT          NaN          0   67
str_value  timestamp
0         a  2014-01-01
1         b  2014-01-03
2         c  2014-01-01
3      None  2014-01-02
output (expected)
str_value  float_value  int_value bool_value
2014-01-01 Equity(65 [A])         a            0          1       True
Equity(66 [B])      None          NaN          0      False
Equity(67 [C])         c            2          3       True
2014-01-02 Equity(65 [A])         a            0          1       True
Equity(66 [B])      None          NaN          0      False
Equity(67 [C])         c            2          0      False
2014-01-03 Equity(65 [A])         a            0          1       True
Equity(66 [B])         b            1          2       True
Equity(67 [C])         c            2          0      False
dt_value
2014-01-01 Equity(65 [A]) 2011-01-01
Equity(66 [B])        NaT
Equity(67 [C]) 2011-01-03
2014-01-02 Equity(65 [A]) 2011-01-01
Equity(66 [B])        NaT
Equity(67 [C]) 2011-01-03
2014-01-03 Equity(65 [A]) 2011-01-01
Equity(66 [B]) 2011-01-02
Equity(67 [C]) 2011-01-03'

def test_cols_with_some_missing_vals(self):

    dates = pd.Index([self.dates[0], self.dates[(-1)], self.dates[0], self.dates[1]])
    df = pd.DataFrame({'sid': (self.ASSET_FINDER_EQUITY_SIDS[:(-1)] + ((self.ASSET_FINDER_EQUITY_SIDS[(-1)],) * 2)), 'float_value': (0.0, 1.0, 2.0, np.NaN), 'str_value': ('a', 'b', 'c', None), 'int_value': (1, 2, 3, 0), 'bool_value': (True, True, True, False), 'dt_value': (pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02'), pd.Timestamp('2011-01-03'), pd.NaT), 'asof_date': (dates - pd.Timedelta(days=2)), 'timestamp': (dates - pd.Timedelta(days=1))})
    expr = bz.data(df, dshape='\n                                                var    *    {\n                                                                    sid:    int64,\n                                                                    float_value:    float64,\n                                                                    str_value:    string,\n                                                                    int_value:    int64,\n                                                                    bool_value:    bool,\n                                                                    dt_value:    datetime,\n                                                                    asof_date:    datetime,\n                                                                    timestamp:    datetime,\n                                                }')
    fields = OrderedDict(expr.dshape.measure.fields)
    expected = pd.DataFrame({'str_value': np.array(['a', None, 'c', 'a', None, 'c', 'a', 'b', 'c'], dtype='object'), 'float_value': np.array([0, np.NaN, 2, 0, np.NaN, 2, 0, 1, 2], dtype='float64'), 'int_value': np.array([1, 0, 3, 1, 0, 3, 1, 2, 3], dtype='int64'), 'bool_value': np.array([True, False, True, True, False, False, True, True, False], dtype='bool'), 'dt_value': [pd.Timestamp('2011-01-01'), pd.NaT, pd.Timestamp('2011-01-03'), pd.Timestamp('2011-01-01'), pd.NaT, pd.Timestamp('2011-01-03'), pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02'), pd.Timestamp('2011-01-03')]}, columns=['str_value', 'float_value', 'int_value', 'bool_value', 'dt_value'], index=pd.MultiIndex.from_product((self.dates, self.asset_finder.retrieve_all(self.ASSET_FINDER_EQUITY_SIDS))))
    self._test_id(df, (var * Record(fields)), expected, self.asset_finder, expected.columns)
