Property Testing Pandas with Bulwark
Zax Rosenberg, CFA
Senior Data Scientist @ SPINS
github.com/ZaxR
www.zaxrosenberg.com
Agenda
About Me
About Me
What is Property Testing?
Checking that some object has certain properties. For example:
some_list = [1, 2, 3, 4]
One property of some_list is that its values are in a range of 1-4. Another is that it’s mutable.
Why is it valuable?
Introducing Bulwark
Introducing Bulwark
Bulwark’s Design
Quickstart - Input
uh oh...
import convention
a check decorator
Quickstart - Result
row index 2, column ‘b’ fails
What if I have multiple checks?
pass a dict of
check: param pairs
What if I have multiple checks?
collects all the errors
What if I don’t want to raise errors?
prints instead of raises
What about when I go to production?
Pro tip: set a centralized config variable that toggles all decorators’ statuses.
doesn’t raise an error
turn off this check
Demo Time!
Where should I use Bulwark?
How should I use Bulwark?
When should I use Bulwark?
Who’s using Bulwark?
Contributing is easy, too!
Find out more