Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16992][PYSPARK] Virtualenv for Pylint and pep8 in lint-python - #14963
[SPARK-16992][PYSPARK] Virtualenv for Pylint and pep8 in lint-python#14963gsemet wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
I have actually added a lot of exclusion here to make the code pass:
- bad-super-call
- consider-iterating-dictionary
- consider-using-enumerate
- eval-used
- exec-used
- invalid-length-returned
- misplaced-comparison-constant
- raising-bad-type
- redefined-variable-type
- trailing-newlines
- trailing-whitespace
- ungrouped-imports
- unnecessary-pass
- unneeded-not
- wrong-import-order
- wrong-import-position
e0ad40a to
bd82d8cCompareThere was a problem hiding this comment.
Note: here I leave the virtualenv of the current environment. tell me if which solution you prefere:
- jump into a custom venv? (this proposal)
- fail if in a virtualenv
- only warn the user if already in a virtualenv
- no warning at all, the user knows what he/she does
There was a problem hiding this comment.
I think if we do jump to a custom virtual env for syntax checking we should at least restore the users existing virtual env after.
There was a problem hiding this comment.
What do you mean with "after"? For the Sphinx build? I think we can do both in this virtual env, this would allow to build without having to do sudo pip install Sphinx-build.
And we can control precisely the version of sphinx in this requirements.txt
In anyway, this virtualenv will be left automatically at the end of the execution of this script.
There was a problem hiding this comment.
Using the virtualenv for the sphinx build sounds reasonable if we are already doing it for pep8. I was thinking that since we explicitly leave the current virtual env if the user is in one we should try and restore it after the script has been run - but if that already happens automatically thats great.
There was a problem hiding this comment.
Actually I'm thinking it may be better not to leave virtualenv if we are inside one. So we don't have this copy paste of the code for desactivating it.
What do you think?
SparkQA
commented
Sep 5, 2016
Test build #64949 has finished for PR 14963 at commit
|
SparkQA
commented
Sep 5, 2016
Test build #64950 has finished for PR 14963 at commit
|
There was a problem hiding this comment.
Wait even simpler[ish] - do we need to deactivate the old env or will activating the new env be enough (provided we store the old VIRTUAL_ENV path to restore to after we deactivate).
There was a problem hiding this comment.
I am open to suggestion. If we are already inside a venv we can expect the user knows what it does and don't desactivate it.
holdenk
commented
Sep 9, 2016
Thanks for working to reenable pylint (super important IMHO). Perhaps @davies could take a look at this approach? |
There was a problem hiding this comment.
Need to add the sphinx version here
holdenk
commented
Sep 9, 2016
Oh wait I've been a little confused by the PR title - pylint is already reenabled and was only temporary disabled awhile back - maybe less important but would make sense in the context of the other PRs you've put together. Could you maybe give this PR a clearer name like "Use virtualenv for pep8" rather than "Reenable Pylint"? |
gsemet
commented
Sep 9, 2016
Hum I don't see how it was reenabled... Where is it called? And I had many errors to ignore once I have reenabled it on the execution of lint-python. I'll update the title. At least, being inside a venv allow to precisely control the version of pep and pylint, this is kind of critical since errors changes from one version to another |
holdenk
commented
Sep 9, 2016
I mean we already have the pep8 version locked since we download a specific version with curl rather than depending on the system version. |
gsemet
commented
Sep 9, 2016
Yes but for pylint you have many dependencies to update as well (astroid,...). At least with a virtualenv, pip does it for us :) |
holdenk
commented
Sep 9, 2016
I also think virtualenv or similar is probably the right way to go for PySpark developer dependencies in the long term :) |
gsemet
commented
Sep 9, 2016
Great ! By the way, I am also working on virtualenv and wheel support for PySpark job deployment (see #14180) |
holdenk
commented
Sep 9, 2016
gsemet
commented
Sep 9, 2016
Great ! |
994bdfd to
3f7db49CompareSparkQA
commented
Sep 9, 2016
Test build #65145 has finished for PR 14963 at commit
|
SparkQA
commented
Sep 9, 2016
Test build #65146 has finished for PR 14963 at commit
|
holdenk
commented
Sep 14, 2016
cc @davies ? |
Rebased + updated PR summary Hello, sorry to bother you, but if this patch gets merged, I can work on the pylint errors and submit new PR I had to add in the ignore list of pylint. If I reenable most of them, here is an extract of errors I get: These are not big errors, but it would be quite easy to fix them and have pylint runing at each pullrequest. Thanks |
3f7db49 to
dff7b23CompareSparkQA
commented
Sep 16, 2016
Test build #65481 has finished for PR 14963 at commit
|
holdenk
commented
Sep 21, 2016
So even though this passes tests - its showing up in the PR dashboard as not for me. It might be easier to get reviewers to take a look if it was listed correctly, if you merge in the latest master the tests will re-run or we can explicitly ask jenkins to retest this. |
gsemet
commented
Sep 21, 2016
What is the PR dashboard ? I usually rebase this patch one or twice a week, I'll do it tomorrow |
holdenk
commented
Sep 21, 2016
oh actually it seems like the PR dashboard updated its self (it lives at https://spark-prs.appspot.com/ and is sometimes used by reviewers to decide which PRs to look at). |
dff7b23 to
ca2dcb2Comparegsemet
commented
Oct 12, 2016
I really think using Spark with Anaconda is a must have. Deploying jobs that runs inside a Conda environment is so fast and efficient. I really want to push for this pull request #14180 that also add anaconda support for executors (thanks to jeff's work). Actually before this PR I never tried Anaconda, and now I use it everyday on jupyter. Anaconda on the driver and executor make totally sense! |
SparkQA
commented
Oct 12, 2016
Test build #66835 has finished for PR 14963 at commit
|
SparkQA
commented
Oct 12, 2016
Test build #66838 has finished for PR 14963 at commit
|
gsemet
commented
Oct 12, 2016
Ho, I have these pylint errors on my ubuntu! Probably I did not rebased correctly. Fixed with new check ignore:
of course, once merged. i can work on fixing this pylint errors ! |
SparkQA
commented
Oct 12, 2016
Test build #66836 has finished for PR 14963 at commit
|
SparkQA
commented
Oct 12, 2016
Test build #66837 has finished for PR 14963 at commit
|
SparkQA
commented
Oct 12, 2016
Test build #66848 has finished for PR 14963 at commit
|
SparkQA
commented
Oct 13, 2016
Test build #66846 has finished for PR 14963 at commit
|
holdenk
commented
Oct 13, 2016
@stibbons however the problem is the virtualenv that gets created when a user is in a conda enviroment is partially broken. |
holdenk
commented
Oct 16, 2016
Also if it would be useful to have a quick chat off-line and then circle back to the PR with the result of our chat let me know - I'd really like to see us get something like this in so we can have better/more consistent linting. |
gsemet
commented
Oct 20, 2016
I agree, just email me :) |
Use a virtualenv for isolation and easy installation. This basically reverts 85a50a6 Might have been a solution to SPARK-9385. Lot of new test disabled. I propose to fix issues in various pull requests (obviously most 'import' order errors should be fixed by my other pull requests such as apache#14830 for documentation examples, which is part of the effort on code style described in apache#14567). Each subsequent pull request will fix one or more error and reenable the according pylint check. List of new disabled checks: - bad-super-call - consider-iterating-dictionary - consider-using-enumerate - eval-used - exec-used - invalid-length-returned - misplaced-comparison-constant - raising-bad-type - redefined-variable-type - trailing-newlines - trailing-whitespace - ungrouped-imports - unnecessary-pass - unneeded-not - wrong-import-order - wrong-import-position Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
132fec8 to
4e27af2CompareSparkQA
commented
Dec 22, 2016
Test build #70518 has finished for PR 14963 at commit
|
gsemet
commented
Jan 9, 2017
Any hope this patch might be integrated ? |
holdenk
commented
Feb 24, 2017
That's a reasonable question, I'll try and look at this some next week but if you've got a chance to look at/address the current comments on it that would be great. |
SparkQA
commented
Feb 25, 2017
Test build #73451 has finished for PR 14963 at commit
|
holdenk
commented
Mar 1, 2017
So under the current jenkins set up this isn't running the Python style checks in Jenkins so it would be good to make sure these work in jenkins (can you update a python file)? |
SparkQA
commented
May 7, 2017
Test build #76550 has finished for PR 14963 at commit
|
ueshin
commented
Jun 26, 2017
Hi, are you still working on this? |
SparkQA
commented
Jul 5, 2017
Test build #79181 has finished for PR 14963 at commit
|
## What changes were proposed in this pull request? This PR proposes to close stale PRs, mostly the same instances with apache#18017Closesapache#14085 - [SPARK-16408][SQL] SparkSQL Added file get Exception: is a directory … Closesapache#14239 - [SPARK-16593] [CORE] [WIP] Provide a pre-fetch mechanism to accelerate shuffle stage. Closesapache#14567 - [SPARK-16992][PYSPARK] Python Pep8 formatting and import reorganisation Closesapache#14579 - [SPARK-16921][PYSPARK] RDD/DataFrame persist()/cache() should return Python context managers Closesapache#14601 - [SPARK-13979][Core] Killed executor is re spawned without AWS key… Closesapache#14830 - [SPARK-16992][PYSPARK][DOCS] import sort and autopep8 on Pyspark examples Closesapache#14963 - [SPARK-16992][PYSPARK] Virtualenv for Pylint and pep8 in lint-python Closesapache#15227 - [SPARK-17655][SQL]Remove unused variables declarations and definations in a WholeStageCodeGened stage Closesapache#15240 - [SPARK-17556] [CORE] [SQL] Executor side broadcast for broadcast joins Closesapache#15405 - [SPARK-15917][CORE] Added support for number of executors in Standalone [WIP] Closesapache#16099 - [SPARK-18665][SQL] set statement state to "ERROR" after user cancel job Closesapache#16445 - [SPARK-19043][SQL]Make SparkSQLSessionManager more configurable Closesapache#16618 - [SPARK-14409][ML][WIP] Add RankingEvaluator Closesapache#16766 - [SPARK-19426][SQL] Custom coalesce for Dataset Closesapache#16832 - [SPARK-19490][SQL] ignore case sensitivity when filtering hive partition columns Closesapache#17052 - [SPARK-19690][SS] Join a streaming DataFrame with a batch DataFrame which has an aggregation may not work Closesapache#17267 - [SPARK-19926][PYSPARK] Make pyspark exception more user-friendly Closesapache#17371 - [SPARK-19903][PYSPARK][SS] window operator miss the `watermark` metadata of time column Closesapache#17401 - [SPARK-18364][YARN] Expose metrics for YarnShuffleService Closesapache#17519 - [SPARK-15352][Doc] follow-up: add configuration docs for topology-aware block replication Closesapache#17530 - [SPARK-5158] Access kerberized HDFS from Spark standalone Closesapache#17854 - [SPARK-20564][Deploy] Reduce massive executor failures when executor count is large (>2000) Closesapache#17979 - [SPARK-19320][MESOS][WIP]allow specifying a hard limit on number of gpus required in each spark executor when running on mesos Closesapache#18127 - [SPARK-6628][SQL][Branch-2.1] Fix ClassCastException when executing sql statement 'insert into' on hbase table Closesapache#18236 - [SPARK-21015] Check field name is not null and empty in GenericRowWit… Closesapache#18269 - [SPARK-21056][SQL] Use at most one spark job to list files in InMemoryFileIndex Closesapache#18328 - [SPARK-21121][SQL] Support changing storage level via the spark.sql.inMemoryColumnarStorage.level variable Closesapache#18354 - [SPARK-18016][SQL][CATALYST][BRANCH-2.1] Code Generation: Constant Pool Limit - Class Splitting Closesapache#18383 - [SPARK-21167][SS] Set kafka clientId while fetch messages Closesapache#18414 - [SPARK-21169] [core] Make sure to update application status to RUNNING if executors are accepted and RUNNING after recovery Closesapache#18432 - resolve com.esotericsoftware.kryo.KryoException Closesapache#18490 - [SPARK-21269][Core][WIP] Fix FetchFailedException when enable maxReqSizeShuffleToMem and KryoSerializer Closesapache#18585 - SPARK-21359 Closesapache#18609 - Spark SQL merge small files to big files Update InsertIntoHiveTable.scala Added: Closesapache#18308 - [SPARK-21099][Spark Core] INFO Log Message Using Incorrect Executor I… Closesapache#18599 - [SPARK-21372] spark writes one log file even I set the number of spark_rotate_log to 0 Closesapache#18619 - [SPARK-21397][BUILD]Maven shade plugin adding dependency-reduced-pom.xml to … Closesapache#18667 - Fix the simpleString used in error messages Closesapache#18782 - Branch 2.1 Added: Closesapache#17694 - [SPARK-12717][PYSPARK] Resolving race condition with pyspark broadcasts when using multiple threads Added: Closesapache#16456 - [SPARK-18994] clean up the local directories for application in future by annother thread Closesapache#18683 - [SPARK-21474][CORE] Make number of parallel fetches from a reducer configurable Closesapache#18690 - [SPARK-21334][CORE] Add metrics reporting service to External Shuffle Server Added: Closesapache#18827 - Merge pull request 1 from apache/master ## How was this patch tested? N/A Author: hyukjinkwon <gurwls223@gmail.com> Closesapache#18780 from HyukjinKwon/close-prs.
Use a virtualenv for isolation and easy installation of
pep8andpylintby thelint-pythonlinter script.This involves 2 changes in this script:
requirements.txt. This will "freeze" the version of the tools used. We don't want the HEAD starting breaking because a new version of pylint has been posted on pypi which add new checks. sphinx version is also "frozen".This basically reverts 85a50a6
Might have been a solution to SPARK-9385 (see #7704)
Lot of new tests introduced by the newer version of pylint have been disabled. I propose to fix issues in various pull requests (obviously most 'import' order errors should be fixed by my other pull requests such as #14830 for documentation examples, which is part of the effort on code style described in #14567). Each subsequent pull request will fix one or more error and reenable the according pylint check.
List of new disabled tests:
How was this patch tested?
Manual execution of
lint-pythonon my machine.