-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-33983][PYTHON] Update cloudpickle to v1.6.0 #31007
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,7 @@ def g(): | |
| DEFAULT_PROTOCOL = pickle.HIGHEST_PROTOCOL | ||
|
|
||
| # Track the provenance of reconstructed dynamic classes to make it possible to | ||
| # reconstruct instances from the matching singleton class definition when | ||
| # recontruct instances from the matching singleton class definition when | ||
| # appropriate and preserve the usual "isinstance" semantics of Python objects. | ||
| _DYNAMIC_CLASS_TRACKER_BY_CLASS = weakref.WeakKeyDictionary() | ||
| _DYNAMIC_CLASS_TRACKER_BY_ID = weakref.WeakValueDictionary() | ||
|
|
@@ -236,7 +236,7 @@ def _extract_code_globals(co): | |
| out_names = {names[oparg] for _, oparg in _walk_global_ops(co)} | ||
|
|
||
| # Declaring a function inside another one using the "def ..." | ||
| # syntax generates a constant code object corresponding to the one | ||
| # syntax generates a constant code object corresonding to the one | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its a copy from cloudpickle. I think I would just keep it as is.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cloudpipe/cloudpickle#406. Let's fix it back when we upgrade next time. |
||
| # of the nested function's As the nested function may itself need | ||
| # global variables, we need to introspect its code, extract its | ||
| # globals, (look for code object in it's co_consts attribute..) and | ||
|
|
@@ -457,7 +457,7 @@ def _is_parametrized_type_hint(obj): | |
| is_typing = getattr(obj, '__origin__', None) is not None | ||
|
|
||
| # typing_extensions.Literal | ||
| is_literal = getattr(obj, '__values__', None) is not None | ||
| is_litteral = getattr(obj, '__values__', None) is not None | ||
|
|
||
| # typing_extensions.Final | ||
| is_final = getattr(obj, '__type__', None) is not None | ||
|
|
@@ -469,7 +469,7 @@ def _is_parametrized_type_hint(obj): | |
| getattr(obj, '__result__', None) is not None and | ||
| getattr(obj, '__args__', None) is not None | ||
| ) | ||
| return any((is_typing, is_literal, is_final, is_union, is_tuple, | ||
| return any((is_typing, is_litteral, is_final, is_union, is_tuple, | ||
| is_callable)) | ||
|
|
||
| def _create_parametrized_type_hint(origin, args): | ||
|
|
@@ -699,7 +699,7 @@ def _make_skel_func(code, cell_count, base_globals=None): | |
| """ | ||
| # This function is deprecated and should be removed in cloudpickle 1.7 | ||
| warnings.warn( | ||
| "A pickle file created using an old (<=1.4.1) version of cloudpickle " | ||
| "A pickle file created using an old (<=1.4.1) version of cloudpicke " | ||
| "is currently being loaded. This is not supported by cloudpickle and " | ||
| "will break in cloudpickle 1.7", category=UserWarning | ||
| ) | ||
|
|
@@ -828,3 +828,15 @@ def _get_bases(typ): | |
| # For regular class objects | ||
| bases_attr = '__bases__' | ||
| return getattr(typ, bases_attr) | ||
|
|
||
|
|
||
| def _make_dict_keys(obj): | ||
| return dict.fromkeys(obj).keys() | ||
|
|
||
|
|
||
| def _make_dict_values(obj): | ||
| return {i: _ for i, _ in enumerate(obj)}.values() | ||
|
|
||
|
|
||
| def _make_dict_items(obj): | ||
| return obj.items() | ||
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.
typo?