-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pyspark] Add type hint to basic utilities. #8375
Conversation
"""Whether it is Spark local mode""" | ||
# pylint: disable=protected-access | ||
return spark_context._jsc.sc().isLocal() | ||
|
||
|
||
def _get_gpu_id(task_context) -> int: | ||
def _get_gpu_id(task_context: BarrierTaskContext) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change it to TaskContext instead of BarrierTaskContext?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted, getTaskInfos
is exclusive to the barrier task context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, only _get_host_ip needs BarrerTaskContext. for others, TaskContext is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since get host ip is called by others, unless we want to perform a down cast we need to pass the type down.
This reverts commit 9c626c5.
No description provided.