We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if they are not class methods then the method would be invoked for every test and a session would be created for each of those tests.
`class PySparkTest(unittest.TestCase): @classmethod def suppress_py4j_logging(cls): logger = logging.getLogger('py4j') logger.setLevel(logging.WARN)
@classmethod def create_testing_pyspark_session(cls): return SparkSession \ .builder \ .master('local[*]') \ .appName("my-local-testing-pyspark-context") \ .getOrCreate() @classmethod def setUpClass(cls): cls.suppress_py4j_logging() cls.spark = cls.create_testing_pyspark_session() cls.test_data_path = "<PATH>" cls.df = cls.spark.read.options(header='true', inferSchema='true') \ .csv(cls.test_data_path) cls.df_exepcted = transform_data(cls.df, cls.spark) @classmethod def tearDownClass(cls): cls.spark.stop()`
The text was updated successfully, but these errors were encountered:
Well spotted - thank you 👍
Sorry, something went wrong.
No branches or pull requests
if they are not class methods then the method would be invoked for every test and a session would be created for each of those tests.
`class PySparkTest(unittest.TestCase):
@classmethod
def suppress_py4j_logging(cls):
logger = logging.getLogger('py4j')
logger.setLevel(logging.WARN)
The text was updated successfully, but these errors were encountered: