Skip to content

Commit 9c29f0d

Browse files
committed
Profile tests: apply black formatting.
1 parent 24ee767 commit 9c29f0d

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

tests/test_profiles.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
11
# -*- coding: utf-8 -*-
22
import unittest
33
from pyspark.sql import Row
4-
from pydeequ.profiles import ColumnProfilerRunBuilder, ColumnProfilerRunner, DistributionValue, StringColumnProfile
4+
from pydeequ.profiles import (
5+
ColumnProfilerRunBuilder,
6+
ColumnProfilerRunner,
7+
DistributionValue,
8+
StringColumnProfile,
9+
)
510
from pydeequ.analyzers import KLLParameters, DataTypeInstances
611
from tests.conftest import setup_pyspark
712

13+
814
class TestProfiles(unittest.TestCase):
915
@classmethod
1016
def setUpClass(cls):
1117
cls.spark = setup_pyspark().appName("test-profiles-local").getOrCreate()
1218
cls.sc = cls.spark.sparkContext
13-
cls.df = cls.sc.parallelize([Row(a="foo", b=1, c=5), Row(a="bar", b=2, c=6), Row(a="baz", b=3, c=None)]).toDF()
19+
cls.df = cls.sc.parallelize(
20+
[Row(a="foo", b=1, c=5), Row(a="bar", b=2, c=6), Row(a="baz", b=3, c=None)]
21+
).toDF()
1422

1523
@classmethod
1624
def tearDownClass(cls):
1725
cls.spark.sparkContext._gateway.shutdown_callback_server()
1826
cls.spark.stop()
1927

2028
def test_setPredefinedTypes(self):
21-
result = ColumnProfilerRunner(self.spark) \
22-
.onData(self.df) \
23-
.setPredefinedTypes({'a': DataTypeInstances.Unknown, 'b': DataTypeInstances.String, 'c': DataTypeInstances.Fractional}) \
29+
result = (
30+
ColumnProfilerRunner(self.spark)
31+
.onData(self.df)
32+
.setPredefinedTypes(
33+
{
34+
"a": DataTypeInstances.Unknown,
35+
"b": DataTypeInstances.String,
36+
"c": DataTypeInstances.Fractional,
37+
}
38+
)
2439
.run()
40+
)
2541
print(result)
2642
for col, profile in result.profiles.items():
2743
print("Profiles:", profile)

0 commit comments

Comments
 (0)