Updating Python code from python2 to python3#58
Open
tallamjr wants to merge 3 commits intodatabricks:masterfrom
Open
Updating Python code from python2 to python3#58tallamjr wants to merge 3 commits intodatabricks:masterfrom
tallamjr wants to merge 3 commits intodatabricks:masterfrom
Conversation
This has been completed using the tool: 2to3
Note, "Structured_APIs-Chapter_6_Working_with_Different_Types_of_Data.py"
could not be updated due to parsing error:
Error:
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse
Structured_APIs-Chapter_6_Working_with_Different_Types_of_Data.py:
ParseError: bad input: type=1, value='as', context=(' ', (334, 69))
Thus, the command run was:
$ 2to3 -w `ls *.py | grep -v *Chapter_6*.py`
See PR databricks#58 for stdout of command for detailed changes
modified: A_Gentle_Introduction_to_Spark-Chapter_3_A_Tour_of_Sparks_Toolset.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_24_Advanced_Analytics_and_Machine_Learning.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_25_Preprocessing_and_Feature_Engineering.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_26_Classification.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_27_Regression.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_28_Recommendation.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_29_Unsupervised_Learning.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_30_Graph_Analysis.py
modified: Advanced_Analytics_and_Machine_Learning-Chapter_31_Deep_Learning.py
modified: Ecosystem-Chapter_32_Language_Specifics.py
modified: Low_Level_APIs-Chapter_12_RDD_Basics.py
modified: Low_Level_APIs-Chapter_13_Advanced_RDDs.py
modified: Production_Applications-Chapter_16_Spark_Applications.py
modified: Structured_APIs-Chapter_5_Basic_Structured_Operations.py
modified: Structured_APIs-Chapter_9_Data_Sources.py
This reverts the changes made in 17655ce to 3 specific files as the changed introduced by 2to3 script are not required for the code to run in Python 3. This has been tested locally in a Jupyter notebook running Python 3.7.6 REF: - databricks@17655ce modified: code/Ecosystem-Chapter_32_Language_Specifics.py modified: code/Low_Level_APIs-Chapter_12_RDD_Basics.py modified: code/Low_Level_APIs-Chapter_13_Advanced_RDDs.py
The 2to3 script added extra brackets around print functions that were already compatible with Python 3. This has now been removed modified: code/Advanced_Analytics_and_Machine_Learning-Chapter_25_Preprocessing_and_Feature_Engineering.py modified: code/Advanced_Analytics_and_Machine_Learning-Chapter_28_Recommendation.py modified: code/Advanced_Analytics_and_Machine_Learning-Chapter_31_Deep_Learning.py
e6084fa to
e551473
Compare
Ppandit-MAF
approved these changes
Dec 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This has been completed using the tool: 2to3
Note, "Structured_APIs-Chapter_6_Working_with_Different_Types_of_Data.py"
could not be updated due to parsing error:
Error:
Thus, the command run was:
See PR #58 for stdout of command for detailed changes