diff --git a/bcpandas/constants.py b/bcpandas/constants.py index 35d7f8b..ba3d1e3 100644 --- a/bcpandas/constants.py +++ b/bcpandas/constants.py @@ -65,13 +65,13 @@ class BCPandasValueError(BCPandasException): def get_delimiter(df: pd.DataFrame) -> str: for delim in _DELIMITER_OPTIONS: - if not df.applymap(lambda x: delim in x if isinstance(x, str) else False).any().any(): + if not df.map(lambda x: delim in x if isinstance(x, str) else False).any().any(): return delim raise BCPandasValueError(error_msg.format(typ="delimiter", opts=_DELIMITER_OPTIONS)) def get_quotechar(df: pd.DataFrame) -> str: for qc in _QUOTECHAR_OPTIONS: - if not df.applymap(lambda x: qc in x if isinstance(x, str) else False).any().any(): + if not df.map(lambda x: qc in x if isinstance(x, str) else False).any().any(): return qc raise BCPandasValueError(error_msg.format(typ="quote", opts=_QUOTECHAR_OPTIONS)) diff --git a/tests/utils.py b/tests/utils.py index e96c0fc..df1c38d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -53,14 +53,14 @@ def not_has_all_delims(df: pd.DataFrame) -> bool: return not all( - df.applymap(lambda x: delim in x if isinstance(x, str) else False).any().any() + df.map(lambda x: delim in x if isinstance(x, str) else False).any().any() for delim in _DELIMITER_OPTIONS ) def not_has_all_quotechars(df: pd.DataFrame) -> bool: return not all( - df.applymap(lambda x: qc in x if isinstance(x, str) else False).any().any() + df.map(lambda x: qc in x if isinstance(x, str) else False).any().any() for qc in _QUOTECHAR_OPTIONS )