@@ -529,6 +529,14 @@ def _read(filepath_or_buffer, kwds):
529
529
'buffer_lines' ,
530
530
'float_precision' ,
531
531
}
532
+
533
+ _deprecated_defaults = {
534
+ 'as_recarray' : None ,
535
+ 'buffer_lines' : None ,
536
+ 'compact_ints' : None ,
537
+ 'use_unsigned' : None ,
538
+ 'tupleize_cols' : None
539
+ }
532
540
_deprecated_args = {
533
541
'as_recarray' ,
534
542
'buffer_lines' ,
@@ -594,7 +602,7 @@ def parser_f(filepath_or_buffer,
594
602
comment = None ,
595
603
encoding = None ,
596
604
dialect = None ,
597
- tupleize_cols = False ,
605
+ tupleize_cols = None ,
598
606
599
607
# Error Handling
600
608
error_bad_lines = True ,
@@ -606,9 +614,9 @@ def parser_f(filepath_or_buffer,
606
614
# Internal
607
615
doublequote = True ,
608
616
delim_whitespace = False ,
609
- as_recarray = False ,
610
- compact_ints = False ,
611
- use_unsigned = False ,
617
+ as_recarray = None ,
618
+ compact_ints = None ,
619
+ use_unsigned = None ,
612
620
low_memory = _c_parser_defaults ['low_memory' ],
613
621
buffer_lines = None ,
614
622
memory_map = False ,
@@ -836,7 +844,7 @@ def _get_options_with_defaults(self, engine):
836
844
'The %r option is not supported with the'
837
845
' %r engine' % (argname , engine ))
838
846
else :
839
- value = default
847
+ value = _deprecated_defaults . get ( argname , default )
840
848
options [argname ] = value
841
849
842
850
if engine == 'python-fwf' :
@@ -962,6 +970,8 @@ def _clean_options(self, options, engine):
962
970
963
971
for arg in _deprecated_args :
964
972
parser_default = _c_parser_defaults [arg ]
973
+ depr_default = _deprecated_defaults [arg ]
974
+
965
975
msg = ("The '{arg}' argument has been deprecated "
966
976
"and will be removed in a future version."
967
977
.format (arg = arg ))
@@ -970,10 +980,13 @@ def _clean_options(self, options, engine):
970
980
msg += ' Please call pd.to_csv(...).to_records() instead.'
971
981
elif arg == 'tupleize_cols' :
972
982
msg += (' Column tuples will then '
973
- 'always be converted to MultiIndex' )
983
+ 'always be converted to MultiIndex. ' )
974
984
975
- if result .get (arg , parser_default ) != parser_default :
985
+ if result .get (arg , depr_default ) != depr_default :
986
+ # raise Exception(result.get(arg, depr_default), depr_default)
976
987
depr_warning += msg + '\n \n '
988
+ else :
989
+ result [arg ] = parser_default
977
990
978
991
if depr_warning != '' :
979
992
warnings .warn (depr_warning , FutureWarning , stacklevel = 2 )
0 commit comments