'Tests that when there is no known data, we get output where the
columns have the right dtypes and the right missing values filled in.
input (self.df):
Empty DataFrame
Columns: [sid, float_value, str_value, int_value, bool_value, dt_value,
asof_date, timestamp]
Index: []
output (expected)
str_value  float_value  int_value
2014-01-01 Equity(65 [A])      None          NaN          0
Equity(66 [B])      None          NaN          0
Equity(67 [C])      None          NaN          0
2014-01-02 Equity(65 [A])      None          NaN          0
Equity(66 [B])      None          NaN          0
Equity(67 [C])      None          NaN          0
2014-01-03 Equity(65 [A])      None          NaN          0
Equity(66 [B])      None          NaN          0
Equity(67 [C])      None          NaN          0
dt_value  bool_value
2014-01-01 Equity(65 [A])      NaT  False
Equity(66 [B])      NaT  False
Equity(67 [C])      NaT  False
2014-01-02 Equity(65 [A])      NaT  False
Equity(66 [B])      NaT  False
Equity(67 [C])      NaT  False
2014-01-03 Equity(65 [A])      NaT  False
Equity(66 [B])      NaT  False
Equity(67 [C])      NaT  False'

def test_cols_with_all_missing_vals(self):

    df = pd.DataFrame(columns=['sid', 'float_value', 'str_value', 'int_value', 'bool_value', 'dt_value', 'asof_date', 'timestamp'])
    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([None, None, None, None, None, None, None, None, None], dtype='object'), 'float_value': np.array([np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN], dtype='float64'), 'int_value': np.array([0, 0, 0, 0, 0, 0, 0, 0, 0], dtype='int64'), 'bool_value': np.array([False, False, False, False, False, False, False, False, False], dtype='bool'), 'dt_value': [pd.NaT, pd.NaT, pd.NaT, pd.NaT, pd.NaT, pd.NaT, pd.NaT, pd.NaT, pd.NaT]}, 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, ('float_value', 'str_value', 'int_value', 'bool_value', 'dt_value'))
