Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

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

## Known Issues

Expand Down
6 changes: 4 additions & 2 deletions tensorflow_data_validation/utils/slicing_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ def feature_value_slicer(record_batch: pa.RecordBatch) -> Iterable[
for col_name in sorted(merged_df.columns):
if col_name in [_PARENT_INDEX_COLUMN, _SLICE_KEY_COLUMN]:
continue
slice_key_col = (_to_slice_key(col_name) + '_' +
merged_df[col_name].apply(_to_slice_key))
feature_value_part = merged_df[col_name].apply(_to_slice_key)
if feature_value_part.empty:
feature_value_part = feature_value_part.astype(pd.StringDtype())
slice_key_col = _to_slice_key(col_name) + '_' + feature_value_part
if index == 0:
merged_df[_SLICE_KEY_COLUMN] = slice_key_col
index += 1
Expand Down