From 8bebdea34d21518f14a5c11ae1e843c70b1cdb65 Mon Sep 17 00:00:00 2001 From: tfx-team Date: Mon, 9 May 2022 08:41:46 -0700 Subject: [PATCH] Raise an error if generators or slicer functions are passed to the StatsOptions.to_json method. PiperOrigin-RevId: 447478064 --- RELEASE.md | 2 ++ tfx/components/statistics_gen/component.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 657f200c06..c28ffd1184 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -30,6 +30,8 @@ conflict. We will rollback this change once `kfp` releases a new version. * Fixed a compatibility issue with apache-airflow 2.3.0 that is failing with "unexpected keyword argument 'default_args'". +* StatisticsGen will raise an error if unsupported StatsOptions (i.e., + generators or experimental_slice_functions) are passed. ## Dependency Updates diff --git a/tfx/components/statistics_gen/component.py b/tfx/components/statistics_gen/component.py index 9fce1d2ccf..addccc4c59 100644 --- a/tfx/components/statistics_gen/component.py +++ b/tfx/components/statistics_gen/component.py @@ -67,8 +67,8 @@ def __init__(self, stats_options: The StatsOptions instance to configure optional TFDV behavior. When stats_options.schema is set, it will be used instead of the `schema` channel input. Due to the requirement that stats_options be - serialized, the slicer functions and custom stats generators are dropped - and are therefore not usable. + serialized, the slicer functions and custom stats generators are not + usable, and an error will be raised if either is specified. exclude_splits: Names of splits where statistics and sample should not be generated. Default behavior (when exclude_splits is set to None) is excluding no splits.