[SPARK-38484][PYTHON] Move usage logging instrumentation util functions from pandas module to pyspark.util module#35790
[SPARK-38484][PYTHON] Move usage logging instrumentation util functions from pandas module to pyspark.util module#35790heyihong wants to merge 5 commits intoapache:masterfrom
Conversation
python/pyspark/util.py
Outdated
|
cc @ueshin FYI |
|
Can one of the admins verify this patch? |
|
@heyihong https://github.com/heyihong/spark/runs/5488300464?check_suite_focus=true got fixed in 54abb85. Would you mind rebasing your PR to fix the build up? |
…ns from pandas module to pyspark.util module
Sure, done |
HyukjinKwon
left a comment
There was a problem hiding this comment.
@heyihong just to double check, it's just moving the codes around right? LGTM
|
cc @ueshin mind taking a look too when you find some time? |
python/pyspark/util.py
Outdated
| for name, prop in inspect.getmembers(missing, lambda o: isinstance(o, property)): | ||
| setattr(missing, name, _wrap_missing_property(original.__name__, name, prop, logger)) | ||
|
|
||
|
|
There was a problem hiding this comment.
I guess we should have another file for these.
There was a problem hiding this comment.
Make sense, I moved the code to instrumentation_utils.py
python/pyspark/util.py
Outdated
|
|
||
|
|
||
| def _attach( | ||
| logger_module: Union[str, ModuleType], modules: Any, classes: Any, missings: Any |
There was a problem hiding this comment.
Is it possible to avoid using Anys?
There was a problem hiding this comment.
Make sense. Changed to stronger types
Yes, no logic changes |
|
Thanks! merging to master. |
What changes were proposed in this pull request?
Move usage logging instrumentation util functions from pandas module to pyspark.util module
Why are the changes needed?
It will be helpful to attach the usage logger to other modules (e.g. sql) besides Pandas but other modules should not depend on Pandas modules to use the instrumentation utils (e.g. _wrap_function, _wrap_property ...).
Does this PR introduce any user-facing change?
No
How was this patch tested?
./bin/pysparkand verified the output: