spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-3458) enable use of python's "with" statements for SparkContext management
Date Tue, 09 Sep 2014 16:49:29 GMT

    [ https://issues.apache.org/jira/browse/SPARK-3458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14127210#comment-14127210
] 

Apache Spark commented on SPARK-3458:
-------------------------------------

User 'mattf' has created a pull request for this issue:
https://github.com/apache/spark/pull/2335

> enable use of python's "with" statements for SparkContext management
> --------------------------------------------------------------------
>
>                 Key: SPARK-3458
>                 URL: https://issues.apache.org/jira/browse/SPARK-3458
>             Project: Spark
>          Issue Type: New Feature
>          Components: PySpark
>            Reporter: Matthew Farrellee
>            Assignee: Matthew Farrellee
>              Labels: features, python, sparkcontext
>
> best practice for managing SparkContexts involves exception handling, e.g.
> {code}
> try:
>   sc = SparkContext()
>   app(sc)
> finally:
>   sc.stop()
> {code}
> python provides the "with" statement to simplify this code, e.g.
> {code}
> with SparkContext() as sc:
>   app(sc)
> {code}
> the SparkContext should be usable in a "with" statement



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message