From e06a4c690127bb58db1fb29fea71793f2139879b Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Mon, 2 Oct 2023 19:02:43 +0200 Subject: [PATCH] Explicitly use Python engine for pandas (#435) Pandas was giving the following warning: ``` /Users/cthoyt/dev/sssom-py/src/sssom/parsers.py:147: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support sep=None with delim_whitespace=False; you can avoid this warning by specifying engine='python'. df = pd.read_csv(table_stream, sep=sep, dtype=str) ``` This PR explicitly specifies the engine to be "python" as suggested. Another alternative would be to set the separator to tab by default, since I don't think we allow SSSOM in CSV (or at least we shouldn't :p) --- src/sssom/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sssom/parsers.py b/src/sssom/parsers.py index 2760a8f2..927d03b2 100644 --- a/src/sssom/parsers.py +++ b/src/sssom/parsers.py @@ -144,7 +144,7 @@ def _read_pandas_and_metadata(input: io.StringIO, sep: str = None): table_stream, metadata_stream = _separate_metadata_and_table_from_stream(input) try: - df = pd.read_csv(table_stream, sep=sep, dtype=str) + df = pd.read_csv(table_stream, sep=sep, dtype=str, engine="python") df.fillna("", inplace=True) except EmptyDataError as e: logging.warning(f"Seems like the dataframe is empty: {e}")