From 7434cd06ad16d64277e5e26422584e04461aee3a Mon Sep 17 00:00:00 2001 From: Taylor Turner Date: Mon, 15 Apr 2024 11:53:33 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"Bug=20fix=20for=20float=20precision?= =?UTF-8?q?=20calculation=20using=20categorical=20data=20with=20t=E2=80=A6?= =?UTF-8?q?"=20(#1133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d3159bd13911892e74c264966fba011d50f20e95. --- dataprofiler/profilers/float_column_profile.py | 5 +---- dataprofiler/tests/profilers/test_float_column_profile.py | 7 ------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/dataprofiler/profilers/float_column_profile.py b/dataprofiler/profilers/float_column_profile.py index 29417584e..bc426a447 100644 --- a/dataprofiler/profilers/float_column_profile.py +++ b/dataprofiler/profilers/float_column_profile.py @@ -305,10 +305,7 @@ def _get_float_precision( # length of sampled cells after all punctuation removed len_per_float = ( - df_series_clean.sample(sample_size) - .astype(object) - .replace(to_replace=r, value="") - .map(len) + df_series_clean.sample(sample_size).replace(to_replace=r, value="").map(len) ).astype(float) # Determine statistics precision diff --git a/dataprofiler/tests/profilers/test_float_column_profile.py b/dataprofiler/tests/profilers/test_float_column_profile.py index 06441dcb7..d79fdd641 100644 --- a/dataprofiler/tests/profilers/test_float_column_profile.py +++ b/dataprofiler/tests/profilers/test_float_column_profile.py @@ -211,13 +211,6 @@ def test_profiled_precision(self): msg=f"Errored for: {sample[0]}", ) - # Validate categorical series with trailing zeros supported - categorical_series = pd.Series( - [202209, 202210, 202211], dtype="category" - ).apply(str) - float_profiler = FloatColumn("Name") - float_profiler.update(categorical_series) - def test_profiled_min(self): # test with multiple values data = np.linspace(-5, 5, 11)