Skip to content

Commit da0b8f7

Browse files
fix: update clarify files to meet formatting reqs
1 parent d0002bc commit da0b8f7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/sagemaker/clarify.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ def __init__(
471471
Args:
472472
target_time_series (str or int): A string or a zero-based integer index.
473473
Used to locate the target time series in the shared input dataset.
474-
If this parameter is a string, then all other parameters except
475-
`dataset_format` must be strings or lists of strings. If
474+
If this parameter is a string, then all other parameters except
475+
`dataset_format` must be strings or lists of strings. If
476476
this parameter is an int, then all other parameters except
477477
`dataset_format` must be ints or lists of ints.
478478
item_id (str or int): A string or a zero-based integer index. Used to
@@ -533,7 +533,9 @@ def __init__(
533533
)
534534
if static_covariates:
535535
if not isinstance(static_covariates, list):
536-
raise ValueError(static_covariates_series_error_message) # static_covariates is not a list
536+
raise ValueError(
537+
static_covariates_series_error_message
538+
) # static_covariates is not a list
537539
if not all([isinstance(value, params_type) for value in static_covariates]):
538540
raise ValueError(
539541
static_covariates_series_error_message
@@ -545,10 +547,14 @@ def __init__(
545547
) # static_covariates is valid, add it
546548
if params_type == str:
547549
# check dataset_format is provided and valid
548-
assert isinstance(dataset_format, TimeSeriesJSONDatasetFormat), "Please provide a valid dataset format."
550+
assert isinstance(
551+
dataset_format, TimeSeriesJSONDatasetFormat
552+
), "Please provide a valid dataset format."
549553
_set(dataset_format.value, "dataset_format", self.time_series_data_config)
550554
else:
551-
assert not dataset_format, "Dataset format should only be provided when data files are JSONs."
555+
assert (
556+
not dataset_format
557+
), "Dataset format should only be provided when data files are JSONs."
552558

553559
def get_time_series_data_config(self):
554560
"""Returns part of an analysis config dictionary."""

tests/unit/test_clarify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def test_time_series_data_config(self, test_case: TimeSeriesDataConfigCase):
584584
static_covariates=None,
585585
dataset_format=TimeSeriesJSONDatasetFormat.COLUMNS,
586586
error=ValueError,
587-
error_message=f"Please do not provide empty strings in ``related_time_series``",
587+
error_message="Please do not provide empty strings in ``related_time_series``",
588588
),
589589
TimeSeriesDataConfigCase( # static_covariates contains blank string
590590
target_time_series="target_time_series",
@@ -594,7 +594,7 @@ def test_time_series_data_config(self, test_case: TimeSeriesDataConfigCase):
594594
static_covariates=["scv4", "scv5", "scv6", ""],
595595
dataset_format=TimeSeriesJSONDatasetFormat.COLUMNS,
596596
error=ValueError,
597-
error_message=f"Please do not provide empty strings in ``static_covariates``",
597+
error_message="Please do not provide empty strings in ``static_covariates``",
598598
),
599599
TimeSeriesDataConfigCase( # dataset_format provided int case
600600
target_time_series=1,

0 commit comments

Comments
 (0)