Skip to content

Commit dc66368

Browse files
committed
fix(test): Update test_to_pipeline expected jar copy command
The test expected the old hardcoded '*3.5*.jar' glob pattern but the source now dynamically detects Spark version from SPARK_HOME/RELEASE. Update the assertion to match the new command string.
1 parent f3e3efa commit dc66368

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

sagemaker-mlops/tests/unit/sagemaker/mlops/feature_store/feature_processor/test_feature_scheduler.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,15 @@ def test_to_pipeline(
305305
[
306306
"pip install --root-user-action=ignore 'sagemaker-feature-store-pyspark>=2,<3'",
307307
(
308-
"python3 -c \"import feature_store_pyspark, shutil, os, glob; "
308+
"python3 -c \"import feature_store_pyspark, shutil, os, glob, re; "
309+
"release_file = os.path.join(os.environ.get('SPARK_HOME', '/usr/lib/spark'), 'RELEASE'); "
310+
"spark_ver = '3.5'; "
311+
"rf = open(release_file).read() if os.path.exists(release_file) else ''; "
312+
"m = re.search(r'Spark (\\d+\\.\\d+)', rf); "
313+
"spark_ver = m.group(1) if m else spark_ver; "
309314
"jars_dir = os.path.join(os.path.dirname(feature_store_pyspark.__file__), 'jars'); "
310315
"[shutil.copy(j, '/usr/lib/spark/jars/') "
311-
"for j in glob.glob(os.path.join(jars_dir, '*3.5*.jar'))]\""
316+
"for j in glob.glob(os.path.join(jars_dir, '*' + spark_ver + '*.jar'))]\""
312317
),
313318
],
314319
None,

0 commit comments

Comments
 (0)