Skip to content

Commit a2e50ce

Browse files
committed
Fix signatore of RangeDistributorFactory
1 parent 779708f commit a2e50ce

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

ascetic_ddd/faker/domain/distributors/m2o/interfaces.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def __call__(
9191
mean: float | None = None,
9292
null_weight: float = 0,
9393
name: str | None = None,
94+
store: IM2ODistributor[T] | None = None,
9495
) -> IM2ODistributor[T]:
9596
"""
9697
Factory for Distributor.

ascetic_ddd/faker/domain/distributors/o2m/range_distributor_adapter.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ def __call__(
177177
skew: float | None = None,
178178
mean: float | None = None,
179179
null_weight: float = 0,
180-
sequence: bool = False,
180+
name: str | None = None,
181+
store: IM2ODistributor[T] | None = None,
181182
) -> IM2ODistributor[T]:
182183
"""
183184
Creates an M2O distributor.
@@ -213,9 +214,12 @@ def __call__(
213214
self._max_val,
214215
)
215216

216-
adapter = RangeDistributorAdapter[T](range_dist)
217+
adapter: IM2ODistributor[T] = RangeDistributorAdapter[T](range_dist)
217218

218219
if null_weight > 0:
219-
return NullableDistributor(adapter, null_weight=null_weight)
220+
adapter = NullableDistributor(adapter, null_weight=null_weight)
221+
222+
if name is not None:
223+
adapter.provider_name = name
220224

221225
return adapter

0 commit comments

Comments
 (0)