Skip to content

Commit eabce9f

Browse files
committed
CLN: Add additional typing information
1 parent af0d2c8 commit eabce9f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pandas/io/stata.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,10 @@ def __init__(self, catarray: Series, encoding: str = "latin-1"):
588588
categories = catarray.cat.categories
589589
self.value_labels = list(zip(np.arange(len(categories)), categories))
590590
self.value_labels.sort(key=lambda x: x[0])
591-
self.text_len = np.int32(0)
592-
self.off = []
593-
self.val = []
594-
self.txt = []
591+
self.text_len = 0
592+
self.off: List[int] = []
593+
self.val: List[int] = []
594+
self.txt: List[bytes] = []
595595
self.n = 0
596596

597597
# Compute lengths and setup lists of offsets and labels
@@ -2131,7 +2131,7 @@ def _prepare_categoricals(self, data: DataFrame) -> DataFrame:
21312131

21322132
is_cat = [is_categorical_dtype(data[col]) for col in data]
21332133
self._is_col_cat = is_cat
2134-
self._value_labels = []
2134+
self._value_labels: List[StataValueLabel] = []
21352135
if not any(is_cat):
21362136
return data
21372137

@@ -2290,8 +2290,8 @@ def _check_column_names(self, data: DataFrame) -> DataFrame:
22902290
return data
22912291

22922292
def _set_formats_and_types(self, dtypes: Series) -> None:
2293-
self.typlist = []
2294-
self.fmtlist = []
2293+
self.fmtlist: List[str] = []
2294+
self.typlist: List[int] = []
22952295
for col, dtype in dtypes.items():
22962296
self.fmtlist.append(_dtype_to_default_stata_fmt(dtype, self.data[col]))
22972297
self.typlist.append(_dtype_to_stata_type(dtype, self.data[col]))

0 commit comments

Comments
 (0)