You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
571 B
20 lines
571 B
1 year ago
|
from io import StringIO
|
||
|
|
||
|
import numpy as np
|
||
|
import pytest
|
||
|
|
||
|
import pandas as pd
|
||
|
import pandas._testing as tm
|
||
|
|
||
|
|
||
|
class BaseParsingTests:
|
||
|
@pytest.mark.parametrize("engine", ["c", "python"])
|
||
|
def test_EA_types(self, engine, data):
|
||
|
df = pd.DataFrame({"with_dtype": pd.Series(data, dtype=str(data.dtype))})
|
||
|
csv_output = df.to_csv(index=False, na_rep=np.nan)
|
||
|
result = pd.read_csv(
|
||
|
StringIO(csv_output), dtype={"with_dtype": str(data.dtype)}, engine=engine
|
||
|
)
|
||
|
expected = df
|
||
|
tm.assert_frame_equal(result, expected)
|