Skip to content

Commit d738df7

Browse files
committed
Use two parameters.
1 parent 690c136 commit d738df7

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

python/pyspark/sql/avro/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _test():
100100
import os
101101
import sys
102102
from pyspark.testing.utils import search_jar
103-
avro_jar = search_jar("external/avro", "spark-avro")
103+
avro_jar = search_jar("external/avro", "spark-avro", "spark-avro")
104104
if avro_jar is None:
105105
print(
106106
"Skipping all Avro Python tests as the optional Avro project was "

python/pyspark/testing/streamingutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"was not set.")
3535
else:
3636
kinesis_asl_assembly_jar = search_jar("external/kinesis-asl-assembly",
37-
"spark-streaming-kinesis-asl-assembly")
37+
"spark-streaming-kinesis-asl-assembly-",
38+
"spark-streaming-kinesis-asl-assembly_")
3839
if kinesis_asl_assembly_jar is None:
3940
kinesis_requirement_message = (
4041
"Skipping all Kinesis Python tests as the optional Kinesis project was "

python/pyspark/testing/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def close(self):
103103
pass
104104

105105

106-
def search_jar(project_relative_path, jar_name_prefix):
106+
def search_jar(project_relative_path, sbt_jar_name_prefix, mvn_jar_name_prefix):
107107
project_full_path = os.path.join(
108108
os.environ["SPARK_HOME"], project_relative_path)
109109

@@ -113,9 +113,9 @@ def search_jar(project_relative_path, jar_name_prefix):
113113
# Search jar in the project dir using the jar name_prefix for both sbt build and maven
114114
# build because the artifact jars are in different directories.
115115
sbt_build = glob.glob(os.path.join(
116-
project_full_path, "target/scala-*/%s-*.jar" % jar_name_prefix))
116+
project_full_path, "target/scala-*/%s*.jar" % sbt_jar_name_prefix))
117117
maven_build = glob.glob(os.path.join(
118-
project_full_path, "target/%s_*.jar" % jar_name_prefix))
118+
project_full_path, "target/%s*.jar" % mvn_jar_name_prefix))
119119
jar_paths = sbt_build + maven_build
120120
jars = [jar for jar in jar_paths if not jar.endswith(ignored_jar_suffixes)]
121121

0 commit comments

Comments
 (0)