Skip to content

Commit

Permalink
modifying more assignments to self.data_label to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankarlos committed Apr 3, 2019
1 parent 69baa9c commit df41bdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,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
4 changes: 2 additions & 2 deletions pandas/tests/io/test_stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_read_dta18(self):
'Floats': 'float data'}
tm.assert_dict_equal(vl, vl_expected)

assert rdr.data_label == 'This is a Ünicode data label'
assert rdr._data_label == 'This is a Ünicode data label'

def test_read_write_dta5(self):
original = DataFrame([(np.nan, np.nan, np.nan, np.nan, np.nan)],
Expand Down Expand Up @@ -499,7 +499,7 @@ def test_timestamp_and_label(self, version):

with StataReader(path) as reader:
assert reader.time_stamp == '29 Feb 2000 14:21'
assert reader.data_label == data_label
assert reader._data_label == data_label

@pytest.mark.parametrize('version', [114, 117])
def test_invalid_timestamp(self, version):
Expand Down

0 comments on commit df41bdb

Please sign in to comment.