Skip to content

Commit

Permalink
Merge pull request pandas-dev#8721 from jorisvandenbossche/to_dict-in…
Browse files Browse the repository at this point in the history
…valid-orient

ERR: leftover from renaming outtype to orient in to_dict
  • Loading branch information
jorisvandenbossche committed Nov 4, 2014
2 parents af2bfb7 + 7e41bcb commit c3dd032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ def to_dict(self, orient='dict'):
elif orient.lower().startswith('r'):
return [dict((k, v) for k, v in zip(self.columns, row))
for row in self.values]
else: # pragma: no cover
raise ValueError("outtype %s not understood" % outtype)
else:
raise ValueError("orient '%s' not understood" % orient)

def to_gbq(self, destination_table, project_id=None, chunksize=10000,
verbose=True, reauth=False):
Expand Down
4 changes: 4 additions & 0 deletions pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4158,6 +4158,10 @@ def test_to_dict(self):

tm.assert_almost_equal(recons_data, expected_records)

def test_to_dict_invalid_orient(self):
df = DataFrame({'A':[0, 1]})
self.assertRaises(ValueError, df.to_dict, orient='invalid')

def test_to_records_dt64(self):
df = DataFrame([["one", "two", "three"],
["four", "five", "six"]],
Expand Down

0 comments on commit c3dd032

Please sign in to comment.