gaogaotiantian commented on code in PR #59169:
URL: https://github.com/apache/spark/pull/59169#discussion_r4395401159
##########
python/pyspark/testing/tests/test_changed_files.py:
##########
@@ -72,6 +72,38 @@ def test_relevance(self):
with self.subTest(desc):
self.assertEqual(self._is_relevant(_TEST_MODULE, files),
expected)
+ def test_entry_point_proxy_selectivity(self):
+ # JVM-launched worker/daemon scripts are never imported by a test, so
they are mapped to the
+ # API module whose use triggers them. The shared worker files are
relevant to every test;
+ # the data source / UDTF runners only to modules that reach their
proxy module. _TEST_MODULE
+ # reaches both sql.datasource and sql.udtf; unrelated_module reaches
neither.
+ worker_file = "python/pyspark/worker.py"
+ datasource_worker = "python/pyspark/sql/worker/create_data_source.py"
+ udtf_worker = "python/pyspark/sql/worker/analyze_udtf.py"
+ unrelated_module = "pyspark.loose_version"
+
+ cases = [
+ ("shared worker relevant to a reaching module", _TEST_MODULE,
worker_file, True),
+ ("shared worker relevant to an unrelated module",
unrelated_module, worker_file, True),
+ (
+ "data source worker relevant via sql.datasource",
+ _TEST_MODULE,
+ datasource_worker,
+ True,
+ ),
+ (
+ "data source worker irrelevant to a non-datasource module",
+ unrelated_module,
+ datasource_worker,
+ False,
+ ),
Review Comment:
This is not a super accurate test. It's a heuristic anyway. We just need
some kind of guard to make sure this selection kind of works.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]