Skip to content

Commit

Permalink
DEPR: deprecate engine keyword from to_csv #11274
Browse files Browse the repository at this point in the history
  • Loading branch information
taeold authored and jreback committed Oct 14, 2015
1 parent 7b37a40 commit eda1924
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.17.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Deprecations
^^^^^^^^^^^^

- The ``pandas.io.ga`` module which implements ``google-analytics`` support is deprecated and will be removed in a future version (:issue:`11308`)
- Deprecate the ``engine`` keyword from ``.to_csv()``, which will be removed in a future version (:issue:`11274`)


.. _whatsnew_0171.performance:

Expand Down
7 changes: 6 additions & 1 deletion pandas/core/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import itertools
import csv
import warnings

common_docstring = """
Parameters
Expand Down Expand Up @@ -1264,7 +1265,11 @@ def __init__(self, obj, path_or_buf=None, sep=",", na_rep='', float_format=None,
tupleize_cols=False, quotechar='"', date_format=None,
doublequote=True, escapechar=None, decimal='.'):

self.engine = engine # remove for 0.13
if engine is not None:
warnings.warn("'engine' keyword is deprecated and "
"will be removed in a future version",
FutureWarning, stacklevel=3)
self.engine = engine # remove for 0.18
self.obj = obj

if path_or_buf is None:
Expand Down
6 changes: 6 additions & 0 deletions pandas/tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,12 @@ def test_to_csv_date_format(self):
self.assertEqual(df_day.to_csv(), expected_default_day)
self.assertEqual(df_day.to_csv(date_format='%Y-%m-%d'), expected_default_day)

# deprecation GH11274
def test_to_csv_engine_kw_deprecation(self):
with tm.assert_produces_warning(FutureWarning):
df = DataFrame({'col1' : [1], 'col2' : ['a'], 'col3' : [10.1] })
df.to_csv(engine='python')

def test_round_dataframe(self):

# GH 2665
Expand Down

0 comments on commit eda1924

Please sign in to comment.