Deprecate AsyncStream.sample
authorHarmon <Harmon758@gmail.com>
Thu, 19 May 2022 16:20:47 +0000 (11:20 -0500)
committerHarmon <Harmon758@gmail.com>
Thu, 19 May 2022 16:20:47 +0000 (11:20 -0500)
https://twittercommunity.com/t/deprecation-announcement-removing-compliance-messages-from-statuses-filter-and-retiring-statuses-sample-from-the-twitter-api-v1-1/170500

tweepy/asynchronous/streaming.py

index 21241e3d6a51605cd788fb6238fc84462980eafb..af68117790d162797258d34df1612c643b101f63 100644 (file)
@@ -328,6 +328,11 @@ class AsyncStream(AsyncBaseStream):
     def sample(self, *, languages=None, stall_warnings=False):
         """Sample realtime Tweets
 
+        .. deprecated:: 4.10
+            `The Twitter API v1.1 endpoint this method uses is now deprecated
+            and will be retired on October 29, 2022.`_ Twitter API v2 can be
+            used instead with :meth:`AsyncStreamingClient.sample`.
+
         Parameters
         ----------
         languages : list[str] | None
@@ -358,6 +363,8 @@ class AsyncStream(AsyncBaseStream):
 
         .. _BCP 47: https://tools.ietf.org/html/bcp47
         .. _advanced search: https://twitter.com/search-advanced
+        .. _The Twitter API v1.1 endpoint this method uses is now deprecated
+            and will be retired on October 29, 2022.: https://twittercommunity.com/t/deprecation-announcement-removing-compliance-messages-from-statuses-filter-and-retiring-statuses-sample-from-the-twitter-api-v1-1/170500
         """
         if self.task is not None and not self.task.done():
             raise TweepyException("Stream is already connected")