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

feat: compute data type profile diff #1077

Closed
wants to merge 1 commit into from
Closed
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 dataprofiler/profilers/column_profile_compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ def diff(
if all_profiles:
for key in all_profiles:
if key in self._profiles and key in other._profiles:
prof_diff = self._profiles[key].diff(other._profiles[key])
diff_profile.update(prof_diff)
diff = profiler_utils.find_diff_of_numbers(
self._profiles[key].data_type_ratio,
other._profiles[key].data_type_ratio,
Expand Down
3 changes: 3 additions & 0 deletions dataprofiler/profilers/profile_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ def diff(self, other_profile: StructuredColProfiler, options: dict = None) -> di
}
)

if "statistics" not in unordered_profile:
unordered_profile["statistics"] = {}

unordered_profile["statistics"].update(
{
"sample_size": profiler_utils.find_diff_of_numbers(
Expand Down
3 changes: 1 addition & 2 deletions dataprofiler/profilers/text_column_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ def diff(self, other_profile: TextColumn, options: dict = None) -> dict:
:rtype: dict
"""
# Make sure other_profile's type matches this class
differences = NumericStatsMixin.diff(self, other_profile, options)
differences = BaseColumnProfiler.diff(self, other_profile, options)

del differences["psi"]
vocab_diff = profiler_utils.find_diff_of_lists_and_sets(
self.vocab, other_profile.vocab
)
Expand Down
Loading