Skip to content

Commit

Permalink
Change type for isinstance
Browse files Browse the repository at this point in the history
  • Loading branch information
abajpai15 committed Apr 10, 2024
1 parent fdf3171 commit 6a21fde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dataprofiler/profilers/unstructured_text_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def _update_vocab(
@BaseColumnProfiler._timeit(name="words")
def _update_words(
self,
data: list | ndarray | DataFrame,
data: list | ndarray | DataFrame | pl.DataFrame,
prev_dependent_properties: dict = None,
subset_properties: dict = None,
) -> None:
Expand All @@ -709,7 +709,7 @@ def _update_words(
:return: None
"""
if not self._is_case_sensitive:
if type(data) is pl.DataFrame:
if isinstance(data, pl.DataFrame):
words = (
[
w.strip(string.punctuation)
Expand All @@ -723,7 +723,7 @@ def _update_words(
for row in data
)
else:
if type(data) is pl.DataFrame:
if isinstance(data, pl.DataFrame):
words = (
[w.strip(string.punctuation) for w in row.str.split(by=" ")]
for row in data
Expand Down Expand Up @@ -766,7 +766,7 @@ def update(self, data: Series | pl.Series) -> TextProfiler:

profile = dict(sample_size=len_data)

if type(data) is pl.Series:
if isinstance(data, pl.Series):
data_pandas = data.to_pandas()
else:
data_pandas = data
Expand Down

0 comments on commit 6a21fde

Please sign in to comment.