Github user brkyvz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13655#discussion_r67002254
  
    --- Diff: python/pyspark/sql/streaming.py ---
    @@ -106,28 +120,34 @@ def active(self):
             """Returns a list of active queries associated with this SQLContext
     
             >>> cq = 
df.write.format('memory').queryName('this_query').startStream()
    -        >>> cqm = sqlContext.streams
    +        >>> cqm = spark.streams
             >>> # get the list of active continuous queries
             >>> [q.name for q in cqm.active]
             [u'this_query']
             >>> cq.stop()
             """
             return [ContinuousQuery(jcq) for jcq in self._jcqm.active()]
     
    +    @ignore_unicode_prefix
         @since(2.0)
    -    def get(self, name):
    +    def get(self, id):
             """Returns an active query from this SQLContext or throws 
exception if an active query
             with this name doesn't exist.
     
    -        >>> df.write.format('memory').queryName('this_query').startStream()
    -        >>> cq = sqlContext.streams.get('this_query')
    +        >>> cq = 
df.write.format('memory').queryName('this_query').startStream()
    +        >>> cq.name
    +        u'this_query'
    +        >>> cq = spark.streams.get(cq.id)
    +        >>> cq.isActive
    +        True
    +        >>> cq = sqlContext.streams.get(cq.id)
             >>> cq.isActive
             True
             >>> cq.stop()
             """
    -        if type(name) != str or len(name.strip()) == 0:
    -            raise ValueError("The name for the query must be a non-empty 
string. Got: %s" % name)
    -        return ContinuousQuery(self._jcqm.get(name))
    +        if not isinstance(id, intlike):
    +            raise ValueError("The id for the query must be an integer. 
Got: %d" % id)
    --- End diff --
    
    just noticed this. I would use a `%s`, otherwise you're trying to format 
something that's not a number as a number. But we entered this field because it 
was likely not a number. Or does it work?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to