Skip to content

Commit 7e9d586

Browse files
wip
1 parent cd20ea8 commit 7e9d586

File tree

7 files changed

+17
-13
lines changed

7 files changed

+17
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ details of use and many examples.
6262

6363
Release notes and details of the latest changes for this specific release
6464
can be found in the Github repository
65-
[here](https://github.com/databrickslabs/dbldatagen/blob/release/v0.3.2/CHANGELOG.md)
65+
[here](https://github.com/databrickslabs/dbldatagen/blob/release/v0.3.3/CHANGELOG.md)
6666

6767
# Installation
6868

dbldatagen/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_version(version):
3333
return version_info
3434

3535

36-
__version__ = "0.3.2" # DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion
36+
__version__ = "0.3.3" # DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion
3737
__version_info__ = get_version(__version__)
3838

3939

dbldatagen/text_generators.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,17 @@ def _get_values_subelement(elem):
477477
num_placeholders = 0
478478
rnd_offset = 0
479479

480-
masked_rows = None
480+
unmasked_rows = None # unmasked_rows is None, indicates that all rows are unmasked
481481

482482
assert isinstance(placeholders, np.ma.MaskedArray), "expecting MaskArray"
483483

484484
# if template is empty, then nothing needs to be done
485485
if template_len > 0 and isinstance(placeholders, np.ma.MaskedArray):
486486
active_rows = ~placeholders.mask
487-
masked_rows = active_rows[:, 0]
487+
unmasked_rows = active_rows[:, 0]
488+
489+
if np.all(active_rows):
490+
unmasked_rows = None
488491

489492
# in the following code, the construct `(not escape) ^ self._escapeSpecialMeaning` means apply
490493
# special meaning if either escape is not true or the option `self._escapeSpecialMeaning` is true.
@@ -506,8 +509,8 @@ def _get_values_subelement(elem):
506509
# random numbers from `rnds` 2d array
507510
bound, valueMappings = self._templateMappings[char]
508511

509-
if masked_rows is not None:
510-
placeholders[masked_rows, num_placeholders] = valueMappings[rnds[masked_rows, rnd_offset]]
512+
if unmasked_rows is not None:
513+
placeholders[unmasked_rows, num_placeholders] = valueMappings[rnds[unmasked_rows, rnd_offset]]
511514
else:
512515
placeholders[:, num_placeholders] = valueMappings[rnds[:, rnd_offset]]
513516

@@ -519,13 +522,13 @@ def _get_values_subelement(elem):
519522
bound, valueMappings = self._templateEscapedMappings[char]
520523

521524
if valueMappings is not None:
522-
if masked_rows is not None:
523-
placeholders[masked_rows, num_placeholders] = valueMappings[rnds[masked_rows, rnd_offset]]
525+
if unmasked_rows is not None:
526+
placeholders[unmasked_rows, num_placeholders] = valueMappings[rnds[unmasked_rows, rnd_offset]]
524527
else:
525528
placeholders[:, num_placeholders] = valueMappings[rnds[:, rnd_offset]]
526529
else:
527-
if masked_rows is not None:
528-
placeholders[masked_rows, num_placeholders] = rnds[masked_rows, rnd_offset]
530+
if unmasked_rows is not None:
531+
placeholders[unmasked_rows, num_placeholders] = rnds[unmasked_rows, rnd_offset]
529532
else:
530533
placeholders[:, num_placeholders] = rnds[:, rnd_offset]
531534
num_placeholders += 1

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
author = 'Databricks Inc'
2929

3030
# The full version, including alpha/beta/rc tags
31-
release = "0.3.2" # DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion
31+
release = "0.3.3" # DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion
3232

3333

3434
# -- General configuration ---------------------------------------------------

python/.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.3.2
2+
current_version = 0.3.3
33
commit = False
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+){0,1}(?P<release>\D*)(?P<build>\d*)

python/dev_require.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pytest-cov
1919
pytest-timeout
2020
rstcheck
2121
prospector
22+
black
2223

2324
# The following packages are only required for building documentation and are not required at runtime
2425
sphinx==5.0.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
setuptools.setup(
3333
name="dbldatagen",
34-
version="0.3.2",
34+
version="0.3.3",
3535
author="Ronan Stokes, Databricks",
3636
description="Databricks Labs - PySpark Synthetic Data Generator",
3737
long_description=long_description,

0 commit comments

Comments
 (0)