Skip to content

Commit

Permalink
add dask config to avoid object vs string errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamar Grey committed Feb 15, 2024
1 parent 541878b commit f9b78dd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions featuretools/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def pd_latlong_df():

@pytest.fixture
def dask_latlong_df(pd_latlong_df):
dask = pytest.importorskip("dask", reason="Dask not installed, skipping")
dask.config.set({"dataframe.convert-string": False})
dd = pytest.importorskip("dask.dataframe", reason="Dask not installed, skipping")
return dd.from_pandas(pd_latlong_df.reset_index(drop=True), npartitions=4)

Expand Down
3 changes: 3 additions & 0 deletions featuretools/tests/entityset_tests/test_ww_es.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime
from pdb import set_trace

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -748,6 +749,8 @@ def latlong_df(request):


def test_replace_dataframe_data_transformation(latlong_df):
dask = pytest.importorskip("dask", reason="Dask not installed, skipping")
dask.config.set({"dataframe.convert-string": False})
initial_df = latlong_df.copy()
initial_df.ww.init(
name="latlongs",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from inspect import isclass
from pdb import set_trace

import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import (
Expand Down Expand Up @@ -215,6 +217,8 @@ def pd_simple_es():
@pytest.fixture
def dd_simple_es(pd_simple_es):
dd = pytest.importorskip("dask.dataframe", reason="Dask not installed, skipping")
dask = pytest.importorskip("dask", reason="Dask not installed, skipping")
dask.config.set({"dataframe.convert-string": False})
dataframes = {}
for df in pd_simple_es.dataframes:
dataframes[df.ww.name] = (
Expand Down Expand Up @@ -349,7 +353,6 @@ def test_not_equal_categorical(simple_es):
False,
]


def test_not_equal_different_dtypes(simple_es):
f1 = Feature(
[
Expand Down
3 changes: 3 additions & 0 deletions featuretools/tests/testing_utils/generate_fake_dataframe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import random
import pytest
from datetime import datetime as dt

import pandas as pd
Expand Down Expand Up @@ -40,6 +41,8 @@ def generate_fake_dataframe(
n_rows=10,
df_name="df",
):
dask = pytest.importorskip("dask", reason="Dask not installed, skipping")
dask.config.set({"dataframe.convert-string": False})
def randomize(values_):
random.seed(10)
values = values_.copy()
Expand Down
4 changes: 4 additions & 0 deletions featuretools/tests/testing_utils/mock_ds.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from datetime import datetime

import numpy as np
Expand Down Expand Up @@ -36,6 +37,9 @@ def make_ecommerce_entityset(with_integer_time_index=False):
\\ / .
L Log
"""
dask = pytest.importorskip("dask", reason="Dask not installed, skipping")
dask.config.set({"dataframe.convert-string": False})

dataframes = make_ecommerce_dataframes(
with_integer_time_index=with_integer_time_index,
)
Expand Down

0 comments on commit f9b78dd

Please sign in to comment.