From 08b73d6e0de226e69c81f78b8f676f51a725747d Mon Sep 17 00:00:00 2001 From: Bryan Freeman Date: Thu, 23 Aug 2018 16:01:45 -0500 Subject: [PATCH] Fixes issue #16300 --- pandas/io/pytables.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index c57b1c3e211f6..27cce20e9d319 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1732,10 +1732,11 @@ def validate_col(self, itemsize=None): itemsize = self.itemsize if c.itemsize < itemsize: raise ValueError( - "Trying to store a string with len [%s] in [%s] " - "column but\nthis column has a limit of [%s]!\n" + "Trying to store a string with len [%s] in the " + "column [%s], but\nthis column has a limit of [%s]!\n" "Consider using min_itemsize to preset the sizes on " - "these columns" % (itemsize, self.cname, c.itemsize)) + "these columns" % (itemsize, self.values[0], + c.itemsize)) return c.itemsize return None