Skip to content

Commit 90c3970

Browse files
authored
Merge pull request #184 from jay90099/r1.1.0
Update TFDV 1.1.0 Release
2 parents 9902bbe + 7d41b84 commit 90c3970

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
* Depends on `google-cloud-bigquery>=1.28.0,<2.21`.
1010
* Depends on `tfx-bsl>=1.1.1,<1.2`.
11+
* Fixes error when using tfdv.experimental_get_feature_value_slicer with
12+
* pandas==1.3.0.
1113

1214
## Known Issues
1315

tensorflow_data_validation/utils/slicing_util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ def feature_value_slicer(record_batch: pa.RecordBatch) -> Iterable[
157157
for col_name in sorted(merged_df.columns):
158158
if col_name in [_PARENT_INDEX_COLUMN, _SLICE_KEY_COLUMN]:
159159
continue
160-
slice_key_col = (_to_slice_key(col_name) + '_' +
161-
merged_df[col_name].apply(_to_slice_key))
160+
feature_value_part = merged_df[col_name].apply(_to_slice_key)
161+
if feature_value_part.empty:
162+
feature_value_part = feature_value_part.astype(pd.StringDtype())
163+
slice_key_col = _to_slice_key(col_name) + '_' + feature_value_part
162164
if index == 0:
163165
merged_df[_SLICE_KEY_COLUMN] = slice_key_col
164166
index += 1

0 commit comments

Comments
 (0)