mirror of
https://github.com/apache/superset.git
synced 2026-04-16 22:55:52 +00:00
chore: enforce more ruff rules (#31447)
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9da65d6bfd
commit
e51b95ffa8
@@ -69,14 +69,14 @@ class BirthNamesGenerator(ExampleDataGenerator):
|
||||
return datetime(year, 1, 1, 0, 0, 0)
|
||||
|
||||
def generate_row(self, dt: datetime) -> dict[Any, Any]:
|
||||
gender = choice([BOY, GIRL])
|
||||
num = randint(1, 100000)
|
||||
gender = choice([BOY, GIRL]) # noqa: S311
|
||||
num = randint(1, 100000) # noqa: S311
|
||||
return {
|
||||
DS: dt,
|
||||
GENDER: gender,
|
||||
NAME: self._names_generator.generate(),
|
||||
NUM: num,
|
||||
STATE: choice(US_STATES),
|
||||
STATE: choice(US_STATES), # noqa: S311
|
||||
NUM_BOYS: num if gender == BOY else 0,
|
||||
NUM_GIRLS: num if gender == GIRL else 0,
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ class StringGenerator:
|
||||
self._max_length = max_length
|
||||
|
||||
def generate(self) -> str:
|
||||
rv_string_length = randint(self._min_length, self._max_length)
|
||||
randomized_letters = choices(self._seed_letters, k=rv_string_length)
|
||||
rv_string_length = randint(self._min_length, self._max_length) # noqa: S311
|
||||
randomized_letters = choices(self._seed_letters, k=rv_string_length) # noqa: S311
|
||||
return "".join(randomized_letters)
|
||||
|
||||
Reference in New Issue
Block a user