Repository: pandas-dev/pandas

Issue:
format ignored in HDFStore.open
```
new_store = pd.HDFStore('data/test.h5', format='table')
new_store['df'] = pd.DataFrame(np.random.rand(5,1))
new_store.put('df2', pd.DataFrame(np.random.rand(5,1)), format='table')
print('df stored as table: %s' % new_store.get_storer('df').is_table)
print('df2 stored as table: %s' % new_store.get_storer('df2').is_table)
```

df stored as table: False
df2 stored as table: True
## INSTALLED VERSIONS

commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-30-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.0



Discussion:
`format` is not a defined parameter to `HDFStore`; only to `put/append`. So I'll mark this as an issue to raise an exception if `format` is passed. We accept `**kwargs` becuase we need to pass args to the file handle open function.

```
In [1]: pd.HDFStore?
Init signature: pd.HDFStore(self, path, mode=None, complevel=None, complib=None, fletcher32=False, **kwargs)
Docstring:
dict-like IO interface for storing pandas objects in PyTables
either Fixed or Table format.

Parameters
----------
path : string
    File path to HDF5 file
mode : {'a', 'w', 'r', 'r+'}, default 'a'

    ``'r'``
        Read-only; no data can be modified.
    ``'w'``
        Write; a new file is created (an existing file with the same
        name would be deleted).
    ``'a'``
        Append; an existing file is opened for reading and writing,
        and if the file does not exist it is created.
    ``'r+'``
        It is similar to ``'a'``, but the file must already exist.
complevel : int, 1-9, default 0
        If a complib is specified compression will be applied
        where possible
complib : {'zlib', 'bzip2', 'lzo', 'blosc', None}, default None
        If complevel is > 0 apply compression to objects written
        in the store wherever possible
fletcher32 : bool, default False
        If applying compression use the fletcher32 checksum

Examples
--------
>>> from pandas import DataFrame
>>> from numpy.random import randn
>>> bar = DataFrame(randn(10, 4))
>>> store = HDFStore('test.h5')
>>> store['foo'] = bar   # write to HDF5
>>> bar = store['foo']   # retrieve
>>> store.close()
File:           ~/pandas/pandas/io/pytables.py
Type:           type
```


Resolving patch:
diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -458,6 +458,10 @@ class HDFStore(StringMixin):
 
     def __init__(self, path, mode=None, complevel=None, complib=None,
                  fletcher32=False, **kwargs):
+
+        if 'format' in kwargs:
+            raise ValueError('format is not a defined argument for HDFStore')
+
         try:
             import tables  # noqa
         except ImportError as ex:  # pragma: no cover


Test patch:
diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py
--- a/pandas/tests/io/test_pytables.py
+++ b/pandas/tests/io/test_pytables.py
@@ -146,6 +146,11 @@ def teardown_method(self, method):
 @pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning")
 class TestHDFStore(Base):
 
+    def test_format_kwarg_in_constructor(self):
+        # GH 13291
+        with ensure_clean_path(self.path) as path:
+            pytest.raises(ValueError, HDFStore, path, format='table')
+
     def test_context(self):
         path = create_tempfile(self.path)
         try: