Skip to content

Commit 807cfc9

Browse files
committed
Update warnings
1 parent d66090c commit 807cfc9

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

examples/log-and-detect/async_simple_logging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def main():
4444

4545
# Poll for detection results with a timeout of 60 seconds
4646
# You can adjust timeout and poll_interval based on your needs
47-
detection_results = await quotient.poll_for_detection(
47+
detection_results = await quotient.logger.poll_for_detection(
4848
log_id=log_id,
4949
timeout=60, # Wait up to 60 seconds for results
5050
poll_interval=2.0, # Check every 2 seconds
@@ -69,7 +69,7 @@ async def main():
6969
"\nNo detection results received. The detection might still be in progress or failed."
7070
)
7171
print("You can try again later with:")
72-
print(f"await quotient.poll_for_detection(log_id='{log_id}')")
72+
print(f"await quotient.logger.poll_for_detection(log_id='{log_id}')")
7373

7474
print("Press Enter to exit...")
7575

quotientai/async_client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ async def log(
250250
Use :meth:`quotient.log()` instead. This method will be removed in a future version.
251251
"""
252252
warnings.warn(
253-
"quotient.logger.log() is deprecated and will be removed in a future version. "
253+
"quotient.logger.log() is deprecated as of 0.4.0 and will be removed in a future version. "
254254
"Please use quotient.log() instead.",
255255
DeprecationWarning,
256256
stacklevel=2
@@ -328,7 +328,17 @@ async def poll_for_detection(
328328
329329
Returns:
330330
Log object with Detection results if successful, None otherwise
331+
332+
.. deprecated:: 0.4.0
333+
Use :meth:`quotient.poll_for_detection()` instead. This method will be removed in a future version.
331334
"""
335+
warnings.warn(
336+
"quotient.logger.poll_for_detection() is deprecated as of 0.4.0 and will be removed in a future version. "
337+
"Please use quotient.poll_for_detection() instead.",
338+
DeprecationWarning,
339+
stacklevel=2
340+
)
341+
332342
if not self._configured:
333343
logger.error(
334344
f"Logger is not configured. Please call init() before getting Detection results."

quotientai/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def log(
275275
Use :meth:`quotient.log()` instead. This method will be removed in a future version.
276276
"""
277277
warnings.warn(
278-
"quotient.logger.log() is deprecated and will be removed in a future version. "
278+
"quotient.logger.log() is deprecated as of 0.4.0 and will be removed in a future version. "
279279
"Please use quotient.log() instead.",
280280
DeprecationWarning,
281281
stacklevel=2
@@ -356,9 +356,12 @@ def poll_for_detection(
356356
357357
Returns:
358358
Log object with Detection results if successful, None otherwise
359+
360+
.. deprecated:: 0.4.0
361+
Use :meth:`quotient.poll_for_detection()` instead. This method will be removed in a future version.
359362
"""
360363
warnings.warn(
361-
"quotient.logger.poll_for_detection() is deprecated and will be removed in a future version. "
364+
"quotient.logger.poll_for_detection() is deprecated as of 0.4.0 and will be removed in a future version. "
362365
"Please use quotient.poll_for_detection() instead.",
363366
DeprecationWarning,
364367
stacklevel=2

0 commit comments

Comments
 (0)