From d3318d39fa40babce7659636039e9eb00e34af63 Mon Sep 17 00:00:00 2001 From: Jack Keene Date: Fri, 23 Aug 2024 11:35:05 +0100 Subject: [PATCH] Revert "Update `on_success` docstring (close #358)" This reverts commit 70b30f984471e6b022433a7534de968cc1a248ff. --- snowplow_tracker/emitter_configuration.py | 8 +++++--- snowplow_tracker/emitters.py | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/snowplow_tracker/emitter_configuration.py b/snowplow_tracker/emitter_configuration.py index 82626fa4..1cf90238 100644 --- a/snowplow_tracker/emitter_configuration.py +++ b/snowplow_tracker/emitter_configuration.py @@ -39,12 +39,13 @@ def __init__( :param batch_size: The maximum number of queued events before the buffer is flushed. Default is 10. :type batch_size: int | None :param on_success: Callback executed after every HTTP request in a flush has status code 200 - Gets passed one argument, an array of dictionaries corresponding to the sent events' payloads + Gets passed the number of events flushed. :type on_success: function | None :param on_failure: Callback executed if at least one HTTP request in a flush has status code other than 200 Gets passed two arguments: 1) The number of events which were successfully sent - 2) An array of dictionaries corresponding to the unsent events' payloads + 2) If method is "post": The unsent data in string form; + If method is "get": An array of dictionaries corresponding to the unsent events' payloads :type on_failure: function | None :param byte_limit: The size event list after reaching which queued events will be flushed :type byte_limit: int | None @@ -104,7 +105,8 @@ def on_failure(self) -> Optional[FailureCallback]: Callback executed if at least one HTTP request in a flush has status code other than 200 Gets passed two arguments: 1) The number of events which were successfully sent - 2) An array of dictionaries corresponding to the unsent events' payloads + 2) If method is "post": The unsent data in string form; + If method is "get": An array of dictionaries corresponding to the unsent events' payloads """ return self._on_failure diff --git a/snowplow_tracker/emitters.py b/snowplow_tracker/emitters.py index e32e7c56..af233566 100644 --- a/snowplow_tracker/emitters.py +++ b/snowplow_tracker/emitters.py @@ -83,12 +83,13 @@ def __init__( :param batch_size: The maximum number of queued events before the buffer is flushed. Default is 10. :type batch_size: int | None :param on_success: Callback executed after every HTTP request in a flush has status code 200 - Gets passed one argument, an array of dictionaries corresponding to the sent events' payloads + Gets passed the number of events flushed. :type on_success: function | None :param on_failure: Callback executed if at least one HTTP request in a flush has status code other than 200 Gets passed two arguments: 1) The number of events which were successfully sent - 2) An array of dictionaries corresponding to the unsent events' payloads + 2) If method is "post": The unsent data in string form; + If method is "get": An array of dictionaries corresponding to the unsent events' payloads :type on_failure: function | None :param byte_limit: The size event list after reaching which queued events will be flushed :type byte_limit: int | None @@ -462,12 +463,13 @@ def __init__( :param batch_size: The maximum number of queued events before the buffer is flushed. Default is 10. :type batch_size: int | None :param on_success: Callback executed after every HTTP request in a flush has status code 200 - Gets passed one argument, an array of dictionaries corresponding to the sent events' payloads + Gets passed the number of events flushed. :type on_success: function | None :param on_failure: Callback executed if at least one HTTP request in a flush has status code other than 200 Gets passed two arguments: 1) The number of events which were successfully sent - 2) An array of dictionaries corresponding to the unsent events' payloads + 2) If method is "post": The unsent data in string form; + If method is "get": An array of dictionaries corresponding to the unsent events' payloads :type on_failure: function | None :param thread_count: Number of worker threads to use for HTTP requests :type thread_count: int