@@ -74,7 +74,7 @@ def __init__(self, dataframe: bigframes.dataframe.DataFrame):
7474 # Initialize data fetching attributes.
7575 self ._batches = dataframe .to_pandas_batches (page_size = initial_page_size )
7676
77- # Now it's safe to set traitlets properties that trigger observers
77+ # set traitlets properties that trigger observers
7878 self .page_size = initial_page_size
7979
8080 # len(dataframe) is expensive, since it will trigger a
@@ -102,12 +102,15 @@ def _css(self):
102102 table_html = traitlets .Unicode ().tag (sync = True )
103103
104104 @traitlets .validate ("page" )
105- def _validate_page (self , proposal : Dict [str , Any ]):
105+ def _validate_page (self , proposal : Dict [str , Any ]) -> int :
106106 """Validate and clamp the page number to a valid range.
107107
108108 Args:
109109 proposal: A dictionary from the traitlets library containing the
110110 proposed change. The new value is in proposal["value"].
111+
112+ Returns:
113+ The validated and clamped page number as an integer.
111114 """
112115
113116 value = proposal ["value" ]
@@ -121,11 +124,15 @@ def _validate_page(self, proposal: Dict[str, Any]):
121124 return max (0 , min (value , max_page ))
122125
123126 @traitlets .validate ("page_size" )
124- def _validate_page_size (self , proposal : Dict [str , Any ]):
127+ def _validate_page_size (self , proposal : Dict [str , Any ]) -> int :
125128 """Validate page size to ensure it's positive and reasonable.
129+
126130 Args:
127131 proposal: A dictionary from the traitlets library containing the
128132 proposed change. The new value is in proposal["value"].
133+
134+ Returns:
135+ The validated page size as an integer.
129136 """
130137 value = proposal ["value" ]
131138
@@ -141,7 +148,7 @@ def _get_next_batch(self) -> bool:
141148 """
142149 Gets the next batch of data from the generator and appends to cache.
143150
144- Return :
151+ Returns :
145152 True if a batch was successfully loaded, False otherwise.
146153 """
147154 if self ._all_data_loaded :
0 commit comments