EPIC Merge Unit Test Dataframes
- Vorherrschende Sprache
- Python
- Sterne
- 850
- Forks
- 96
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
This epic encompasses a refactoring of unit tests to merge together dataframes within unit test modules to minimize lines of code as well as minimize impact of Woodwork changes. It would be nice to merge all test dataframes into a single dataframe within the unit test module with column names that are descriptive of the data within and what behavior they're trying to invoke.
Code chunks like:
```
def test_first():
df = pd.DataFrame({"a":[1,2,3], "b":["a", "b", "c"], "c": ["cats", "are", "great"]})
df.ww.init(logical_types = {"a": "Double"})
...
def test_second():
df = pd.DataFrame({"a":[1,2,np.nan], "b":["a", pd.NA, "c"], "c": ["cats", pd.NA, "great"]})
df.ww.init(logical_types = {"a": "Double"})
...
```
Merge to something like:
```
@pytest.mark.fixture
def df():
df = pd.DataFrame({"integers":[1,2,3],
"categories":["a", "b", "c"],
"strings": ["cats", "are", "great"],
"integers_with_nan":[1,2,np.nan],
"categories_with_nan":["a", pd.NA, "c"],
"strings_with_nan": ["cats", pd.NA, "great"]})
df.ww.init(logical_types={"a":"Double"})
def test_first(df):
...
def test_second(df):
...
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.