Closed bjackman closed 7 years ago
A simple test to catch the failure is:
dfr = pd.DataFrame({12: [1, 2, 3], 13: [3, 4, 5]})
constraint = Constraint(dfr, AttrConf.PIVOT, 12, template=None,
trace_index=0, filters={}, window=None)
self.assertEqual(str(constraint), "DataFrame 0:12")
In general I'm happy with testing internal APIs. If at some point they fail because that particular API is no longer used we can get rid of the test.
I have added the test to your commit and merged it as 085a026. Thanks!
Pandas DataFrame columns may be named with any hashable object.
I haven't changed the code for when the data comes from a Trappy trace. I don't think it's necessary (because self.column is always a string - right?) and I haven't figured out how to test it.