class TradingPairPricing(DataSet): """ Dataset representing daily trading prices and volumes. """ open = Column(float64_dtype) high = Column(float64_dtype) low = Column(float64_dtype) close = Column(float64_dtype) volume = Column(float64_dtype)
def test_failure_timing_on_bad_dtypes(self): # Just constructing a bad column shouldn't fail. Column(dtype=int64_dtype) with self.assertRaises(NoDefaultMissingValue) as e: class BadDataSet(DataSet): bad_column = Column(dtype=int64_dtype) float_column = Column(dtype=float64_dtype) int_column = Column(dtype=int64_dtype, missing_value=3) self.assertTrue( str(e.exception.args[0]).startswith( "Failed to create Column with name 'bad_column'")) Column(dtype=complex128_dtype) with self.assertRaises(UnsupportedDType): class BadDataSetComplex(DataSet): bad_column = Column(dtype=complex128_dtype) float_column = Column(dtype=float64_dtype) int_column = Column(dtype=int64_dtype, missing_value=3)
class EventDataSet(DataSet): previous_event_date = Column(dtype=datetime64ns_dtype) next_event_date = Column(dtype=datetime64ns_dtype) previous_float = Column(dtype=float64_dtype) next_float = Column(dtype=float64_dtype) previous_datetime = Column(dtype=datetime64ns_dtype) next_datetime = Column(dtype=datetime64ns_dtype) previous_int = Column(dtype=int64_dtype, missing_value=-1) next_int = Column(dtype=int64_dtype, missing_value=-1) previous_string = Column(dtype=categorical_dtype, missing_value=None) next_string = Column(dtype=categorical_dtype, missing_value=None) previous_string_custom_missing = Column( dtype=categorical_dtype, missing_value=u"<<NULL>>", ) next_string_custom_missing = Column( dtype=categorical_dtype, missing_value=u"<<NULL>>", )
class BadDataSetComplex(DataSet): bad_column = Column(dtype=complex128_dtype) float_column = Column(dtype=float64_dtype) int_column = Column(dtype=int64_dtype, missing_value=3)
class SubDataSetNewCol(SomeDataSet): qux = Column(float64_dtype)
class SomeDataSet(DataSet): foo = Column(float64_dtype) bar = Column(float64_dtype) buzz = Column(float64_dtype)