Skip to content

Commit

Permalink
Work around python 3.9 fussiness
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Apr 3, 2024
1 parent 63ec1b4 commit e08fb96
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ def __init__(
# fillna
pd_.set_option("future.no_silent_downcasting", True)

# Putting this here rather than in the class body before
# Python < 3.10 has fussier rules about staticmethods
self._SUMMARIZERS = {
ColumnDisplayType.Boolean: self._summarize_boolean,
ColumnDisplayType.Number: self._summarize_number,
ColumnDisplayType.String: self._summarize_string,
}

def invalidate_computations(self):
self.filtered_indices = self.view_indices = None
self._need_recompute = True
Expand Down Expand Up @@ -662,12 +670,6 @@ def _summarize_boolean(col: "pd.Series"):
boolean_stats=SummaryStatsBoolean(true_count=true_count, false_count=false_count),
)

_SUMMARIZERS = {
ColumnDisplayType.Boolean: _summarize_boolean,
ColumnDisplayType.Number: _summarize_number,
ColumnDisplayType.String: _summarize_string,
}

def _prof_freq_table(self, column_index: int):
raise NotImplementedError

Expand Down

0 comments on commit e08fb96

Please sign in to comment.