Skip to content

Commit 4f38908

Browse files
committed
Updated pr.
1 parent 393471a commit 4f38908

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ads/dataset/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ def __init__(
8888
# to keep performance high and linear no matter the size of the distributed dataset we
8989
# create a pandas df that's used internally because this has a fixed upper size.
9090
#
91-
if not isinstance(shape, Tuple):
91+
if shape is None:
9292
shape = df.shape
9393

94-
if not isinstance(sampled_df, pd.DataFrame):
94+
if sampled_df is None:
9595
sampled_df = generate_sample(
9696
df,
9797
shape[0],

ads/dataset/dataset_with_target.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def __init__(
7777
**kwargs,
7878
):
7979
self.recommendation_transformer = None
80-
if not isinstance(shape, Tuple):
80+
if shape is None:
8181
shape = df.shape
82-
if not isinstance(sampled_df, pd.DataFrame):
82+
if sampled_df is None:
8383
sampled_df = generate_sample(
8484
df,
8585
shape[0],
@@ -161,7 +161,7 @@ def __init__(
161161
cols.insert(0, cols.pop(cols.index(target)))
162162
self.sampled_df = self.sampled_df[[*cols]]
163163

164-
if not isinstance(target_type, TypedFeature):
164+
if target_type is None:
165165
target_type = get_target_type(target, sampled_df, **kwargs)
166166
self.target = TargetVariable(self, target, target_type)
167167

@@ -192,7 +192,7 @@ def from_dataframe(
192192
from ads.dataset.forecasting_dataset import ForecastingDataset
193193
from ads.dataset.regression_dataset import RegressionDataset
194194

195-
if not isinstance(sampled_df, pd.DataFrame):
195+
if sampled_df is None:
196196
sampled_df = generate_sample(
197197
df,
198198
(shape or df.shape)[0],
@@ -201,7 +201,7 @@ def from_dataframe(
201201
**init_kwargs,
202202
)
203203

204-
if not isinstance(target_type, TypedFeature):
204+
if target_type is None:
205205
target_type = get_target_type(target, sampled_df, **init_kwargs)
206206

207207
if len(df[target].dropna()) == 0:

0 commit comments

Comments
 (0)