Skip to content

Commit

Permalink
Deprecate AsyncStream.sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed May 19, 2022
1 parent 9051ba6 commit e043074
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tweepy/asynchronous/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ def filter(self, *, follow=None, track=None, locations=None,
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
Expand Down Expand Up @@ -358,6 +363,8 @@ def sample(self, *, languages=None, stall_warnings=False):
.. _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")
Expand Down

0 comments on commit e043074

Please sign in to comment.