Skip to content

[SPARK-56242][PYTHON][TESTS] Add a test to ensure no 3rd party libraries are imported for "import pyspark"#55037

Open
gaogaotiantian wants to merge 1 commit intoapache:masterfrom
gaogaotiantian:check-import-time
Open

[SPARK-56242][PYTHON][TESTS] Add a test to ensure no 3rd party libraries are imported for "import pyspark"#55037
gaogaotiantian wants to merge 1 commit intoapache:masterfrom
gaogaotiantian:check-import-time

Conversation

@gaogaotiantian
Copy link
Contributor

What changes were proposed in this pull request?

A new test is added. The new test runs python -X importtime -c "import pyspark" to get the import dependency and checks whether 3rd party libraries are imported.

Why are the changes needed?

2 weeks ago import pyspark takes 200+ms, now it's 60ms - most of it because we lazy loaded memory_profiler. Make import pyspark fast is important for user experience. It's also critical for our worker spawn time. The only way to keep it fast is to add a test to check against it.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Test passed locally.

Was this patch authored or co-authored using generative AI tooling?

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant