Skip to content

Commit

Permalink
Change total row number computation
Browse files Browse the repository at this point in the history
  • Loading branch information
pecop2 committed Jan 27, 2022
1 parent e5c6fc3 commit a6cc7db
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/whylogs/core/datasetprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ def __init__(

self.model_profile = model_profile

self.column_row_dict = dict()

# Store Name attribute
self._tags["name"] = name

Expand Down Expand Up @@ -167,8 +165,7 @@ def session_timestamp_ms(self):

@property
def total_row_number(self):
dict_counts = self.column_row_dict.values() if len(self.column_row_dict) else [0]
return max(dict_counts)
return max([col_prof.counters.count for col_prof in self.columns.values()])

def add_output_field(self, field: Union[str, List[str]]):
if self.model_profile is None:
Expand Down Expand Up @@ -265,11 +262,6 @@ def track_datum(self, column_name, data, character_list=None, token_method=None)
prof = ColumnProfile(column_name, constraints=constraints)
self.columns[column_name] = prof

self.column_row_dict[column_name] = 0

# updating the map for every column name with increasing the number of tracked values
self.column_row_dict[column_name] += 1

prof.track(data, character_list=None, token_method=None)

def track_multi_column(self, columns):
Expand Down

0 comments on commit a6cc7db

Please sign in to comment.