Skip to content

Commit

Permalink
CLN: Add additional typing information
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Jan 20, 2020
1 parent af0d2c8 commit eabce9f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ def __init__(self, catarray: Series, encoding: str = "latin-1"):
categories = catarray.cat.categories
self.value_labels = list(zip(np.arange(len(categories)), categories))
self.value_labels.sort(key=lambda x: x[0])
self.text_len = np.int32(0)
self.off = []
self.val = []
self.txt = []
self.text_len = 0
self.off: List[int] = []
self.val: List[int] = []
self.txt: List[bytes] = []
self.n = 0

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

is_cat = [is_categorical_dtype(data[col]) for col in data]
self._is_col_cat = is_cat
self._value_labels = []
self._value_labels: List[StataValueLabel] = []
if not any(is_cat):
return data

Expand Down Expand Up @@ -2290,8 +2290,8 @@ def _check_column_names(self, data: DataFrame) -> DataFrame:
return data

def _set_formats_and_types(self, dtypes: Series) -> None:
self.typlist = []
self.fmtlist = []
self.fmtlist: List[str] = []
self.typlist: List[int] = []
for col, dtype in dtypes.items():
self.fmtlist.append(_dtype_to_default_stata_fmt(dtype, self.data[col]))
self.typlist.append(_dtype_to_stata_type(dtype, self.data[col]))
Expand Down

0 comments on commit eabce9f

Please sign in to comment.