File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
tensorflow_data_validation/utils Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
* Depends on ` google-cloud-bigquery>=1.28.0,<2.21 ` .
10
10
* 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.
11
13
12
14
## Known Issues
13
15
Original file line number Diff line number Diff line change @@ -157,8 +157,10 @@ def feature_value_slicer(record_batch: pa.RecordBatch) -> Iterable[
157
157
for col_name in sorted (merged_df .columns ):
158
158
if col_name in [_PARENT_INDEX_COLUMN , _SLICE_KEY_COLUMN ]:
159
159
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
162
164
if index == 0 :
163
165
merged_df [_SLICE_KEY_COLUMN ] = slice_key_col
164
166
index += 1
You can’t perform that action at this time.
0 commit comments