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

update categorical profiler #1136

Merged

Conversation

atl1502
Copy link
Contributor

@atl1502 atl1502 commented Apr 23, 2024

No description provided.

@atl1502 atl1502 requested a review from a team as a code owner April 23, 2024 22:07
@taylorfturner taylorfturner enabled auto-merge (squash) April 24, 2024 01:49
@@ -678,6 +681,9 @@ def update(self, df_series: Series) -> CategoricalColumn:
:return: updated CategoricalColumn
:rtype: CategoricalColumn
"""
# TODO remove onces profiler builder is updated
if type(df_series) == pd.Series:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if type(df_series) == pd.Series:
if isinstance(df_series, pd.Series):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want to validate but this is a bit cleaner

Comment on lines 23 to 24
maxDiff = None

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def remove

@@ -883,7 +888,8 @@ def test_json_encode(self):
self.assertEqual(serialized, expected)

def test_json_encode_after_update(self):
df_categorical = pd.Series(
df_categorical = pl.Series(
None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why None outside []?

auto-merge was automatically disabled April 24, 2024 17:55

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) April 24, 2024 17:56
taylorfturner
taylorfturner previously approved these changes Apr 24, 2024
Comment on lines 606 to 607
value_counts = df_series.value_counts(sort=True)
category_count: dict = dict(value_counts.iter_rows())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value_counts = df_series.value_counts(sort=True)
category_count: dict = dict(value_counts.iter_rows())
category_count: dict = dict(df_series.value_counts(sort=True).iter_rows())

why not 1 line? Does this not run?

auto-merge was automatically disabled April 24, 2024 19:25

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) April 24, 2024 20:06
@taylorfturner taylorfturner merged commit ce11b78 into capitalone:feature/polars Apr 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants