10
Stop mocking me! Unit tests in PySpark using Python’s mock library

Stop mocking me! Unit tests in PySpark using Python’s mock library

6 years ago
Anonymous $L9wC17otzH

https://towardsdatascience.com/stop-mocking-me-unit-tests-in-pyspark-using-pythons-mock-library-a4b5cd019d7e

Fundamental in software development, and often overlooked by data scientists, but important. In this post, I’ll show how to do unit testing in PySpark using Python’s unittest.mock library. I’ll do this from a data scientist’s perspective- to me that means that I won’t go into the software engineering details. I present just what you need to know.

First, a (semi) relevant clip from Family Guy:

Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
5 minutes ago
Reputation
0
Spam
0.000
Last Seen
23 minutes ago
Reputation
0
Spam
0.000
Last Seen
49 minutes ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
2 hours ago
Reputation
0
Spam
0.000
Last Seen
22 minutes ago
Reputation
0
Spam
0.000
Last Seen
44 minutes ago
Reputation
0
Spam
0.000
Last Seen
20 minutes ago
Reputation
0
Spam
0.000