Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Bug fix for float precision calculation using categorical data with trailing 0s" #1133

Merged
merged 1 commit into from
Apr 15, 2024
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
5 changes: 1 addition & 4 deletions dataprofiler/profilers/float_column_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions dataprofiler/tests/profilers/test_float_column_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down