Skip to content

Commit

Permalink
apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jalencato committed Nov 11, 2024
1 parent 0e7c471 commit ca46211
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ def __init__(
feature_config: FeatureConfig,
spark: SparkSession,
json_representation: dict,
edge_mapping_dict: dict = None,
):
feat_type = feature_config.feat_type
feat_name = feature_config.feat_name
args_dict = feature_config.transformation_kwargs
self.transformation: DistributedTransformation
# We use this to re-apply transformations
self.json_representation = json_representation
# Node Mapping Info for hard negative feature transformation
self.edge_mapping_dict = edge_mapping_dict

default_kwargs = {
"cols": feature_config.cols,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def test_hard_negative_example_list(spark: SparkSession, check_df_schema, tmp_pa
expected_output = [[1, -1, -1, -1], [2, 3, -1, -1], [3, 0, 1, -1], [0, -1, -1, -1]]

for idx, row in enumerate(output_data):
np.testing.assert_equal(
row[0], expected_output[idx], err_msg=f"Row {idx} is not equal"
)
np.testing.assert_equal(row[0], expected_output[idx], err_msg=f"Row {idx} is not equal")


def test_hard_negative_example_str(spark: SparkSession, check_df_schema, tmp_path):
Expand Down Expand Up @@ -107,6 +105,4 @@ def test_hard_negative_example_str(spark: SparkSession, check_df_schema, tmp_pat
expected_output = [[1, -1, -1, -1], [2, 3, -1, -1], [3, 0, 1, -1], [0, -1, -1, -1]]

for idx, row in enumerate(output_data):
np.testing.assert_equal(
row[0], expected_output[idx], err_msg=f"Row {idx} is not equal"
)
np.testing.assert_equal(row[0], expected_output[idx], err_msg=f"Row {idx} is not equal")

0 comments on commit ca46211

Please sign in to comment.