Skip to content

Commit

Permalink
Remove pandas.io.stata from Typing Blacklist (#25940)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankarlos authored and jreback committed Apr 10, 2019
1 parent 2769ebf commit 6bb9ab8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ ignore_errors=True
[mypy-pandas.io.pytables]
ignore_errors=True

[mypy-pandas.io.stata]
ignore_errors=True

[mypy-pandas.util._doctools]
ignore_errors=True

Expand Down
12 changes: 6 additions & 6 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import numpy as np

from pandas._libs.lib import infer_dtype
from pandas._libs.tslibs import NaT, Timestamp
from pandas._libs.writers import max_len_string_array
from pandas.compat import lmap, lrange, lzip
from pandas.util._decorators import Appender, deprecate_kwarg
Expand All @@ -31,8 +30,8 @@
ensure_object, is_categorical_dtype, is_datetime64_dtype)

from pandas import (
DatetimeIndex, compat, concat, isna, to_datetime, to_timedelta)
from pandas.core.arrays import Categorical
Categorical, DatetimeIndex, NaT, Timestamp, compat, concat, isna,
to_datetime, to_timedelta)
from pandas.core.base import StringMixin
from pandas.core.frame import DataFrame
from pandas.core.series import Series
Expand Down Expand Up @@ -1050,7 +1049,7 @@ def _read_new_header(self, first_char):

self.nobs = self._get_nobs()
self.path_or_buf.read(11) # </N><label>
self.data_label = self._get_data_label()
self._data_label = self._get_data_label()
self.path_or_buf.read(19) # </label><timestamp>
self.time_stamp = self._get_time_stamp()
self.path_or_buf.read(26) # </timestamp></header><map>
Expand Down Expand Up @@ -1237,7 +1236,7 @@ def _read_old_header(self, first_char):
self.path_or_buf.read(2))[0]
self.nobs = self._get_nobs()

self.data_label = self._get_data_label()
self._data_label = self._get_data_label()

self.time_stamp = self._get_time_stamp()

Expand Down Expand Up @@ -1740,11 +1739,12 @@ def _do_convert_categoricals(self, data, value_label_dict, lbllist,
data = DataFrame.from_dict(OrderedDict(cat_converted_data))
return data

@property
def data_label(self):
"""
Return data label of Stata file.
"""
return self.data_label
return self._data_label

def variable_labels(self):
"""
Expand Down

0 comments on commit 6bb9ab8

Please sign in to comment.