Skip to content

Commit 38471a7

Browse files
new lint fixes (#75)
1 parent 0f89fd8 commit 38471a7

File tree

8 files changed

+10
-19
lines changed

8 files changed

+10
-19
lines changed

dbldatagen/data_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def __init__(self, sparkSession=None, name=None, randomSeedMethod=None,
9393
self._seedMethod = randomSeedMethod
9494

9595
if randomSeed is None:
96-
self._instanceRandomSeed = self._randomSeed
96+
self._instanceRandomSeed = self._randomSeed
9797

9898
if randomSeedMethod is None:
9999
self._seedMethod = RANDOM_SEED_HASH_FIELD_NAME
@@ -358,7 +358,7 @@ def _processOptions(self):
358358
for key, value in self._options.items():
359359
if key == "startingId":
360360
self.starting_id = value
361-
elif key == "rowCount" or key == "row_count":
361+
elif key in ["rowCount", "row_count"]:
362362
self._rowCount = value
363363
return self
364364

dbldatagen/datagen_constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@
2525
RANDOM_SEED_RANDOM_FLOAT = -1.0
2626
RANDOM_SEED_FIXED = "fixed"
2727
RANDOM_SEED_HASH_FIELD_NAME = "hash_fieldname"
28-

dbldatagen/text_generator_plugins.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,14 @@ def _loadLibrary(self, lib):
364364
raise DataGenError("Could not load or initialize Faker library", err)
365365

366366

367-
368-
369-
370367
def fakerText(mname, *args, _lib=None, _rootClass=None, **kwargs):
371368
"""Generate faker text generator object using default FakerTextFactory
372369
instance
373370
371+
:param mname: method name to invoke
372+
:param args: positional args to be passed to underlying Faker instance
373+
:param _lib: internal only param - library to load
374+
:param _rootClass: internal only param - root class to create
374375
:returns : instance of PyfuncText for use with Faker
375376
376377
``fakerText("sentence")`` is same as ``FakerTextFactory()("sentence")``

dbldatagen/text_generators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ def stringsFromSingleTemplate(self, baseValue, genTemplate, escapeSpecialMeaning
279279
use_value = False
280280
template_len = len(genTemplate)
281281

282-
# in the following code, the construct `(not escape) ^ self._escapeSpecialMeaning` means apply special meaning if
283-
# either escape is not true or the option `self._escapeSpecialMeaning` is true.
282+
# in the following code, the construct `(not escape) ^ self._escapeSpecialMeaning` means apply
283+
# special meaning if either escape is not true or the option `self._escapeSpecialMeaning` is true.
284284
# This corresponds to the logical xor operation
285285
for i in range(0, template_len):
286286
char = genTemplate[i]

dbldatagen/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class DataGenError(Exception):
4444
def __init__(self, msg, baseException=None):
4545
""" constructor
4646
"""
47+
super().__init__(msg)
4748
self._underlyingException = baseException
4849
self._msg = msg
4950

tests/test_basic_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ def test_percent_nulls(self):
355355
self.assertGreaterEqual( percent_nulls_observed, 5.0)
356356

357357

358-
359358
# run the tests
360359
# if __name__ == '__main__':
361360
# print("Trying to run tests")

tests/test_data_generation_plugins.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class TestTextGenerationPlugins(unittest.TestCase):
1313
row_count = 15000
1414
column_count = 10
1515

16-
1716
def test_plugins(self):
1817
partitions_requested = 4
1918
data_rows = 100 * 1000
@@ -176,7 +175,7 @@ def initPluginContext(context):
176175
output = list(textGen.pandasGenerateText(inputSeries))
177176

178177
for x in output:
179-
self.assertEquals(x, "testing1again")
178+
self.assertEqual(x, "testing1again")
180179

181180
def test_plugins_faker_integration(self):
182181
""" test faker integration with mock objects"""
@@ -235,13 +234,6 @@ def test_plugins_faker_integration2(self):
235234
self.assertTrue(x["name"].startswith("<MagicMock"))
236235

237236

238-
239-
240-
241-
242-
243-
244-
245237
# run the tests
246238
# if __name__ == '__main__':
247239
# print("Trying to run tests")

tests/test_quick_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,6 @@ def test_strings_from_numeric_string_field4(self):
699699
self.assertEqual(rowCount, 0)
700700

701701

702-
703702
# run the tests
704703
# if __name__ == '__main__':
705704
# print("Trying to run tests")

0 commit comments

Comments
 (0)