File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1405,13 +1405,35 @@ Filter Warnings
1405
1405
1406
1406
This example shows how to suppress the :class :`neo4j.ExperimentalWarning` using the :func:`python:warnings.filterwarnings` function.
1407
1407
1408
+ .. code- block:: python
1409
+
1410
+ import warnings
1411
+ from neo4j import ExperimentalWarning
1412
+
1413
+ ...
1414
+
1415
+ with warnings.catch_warnings():
1416
+ warnings.filterwarnings(" ignore" , category = ExperimentalWarning)
1417
+ ... # the call emitting the ExperimentalWarning
1418
+
1419
+ ...
1420
+
1421
+ This will only mute the :class :`neo4j.ExperimentalWarning` for everything inside
1422
+ the `` with `` - block. This is the preferred way to mute warnings, as warnings
1423
+ triggerd by new code will still be visible.
1424
+
1425
+ However, should you want to mute it for the entire application, use the
1426
+ following code:
1427
+
1408
1428
.. code- block:: python
1409
1429
1410
1430
import warnings
1411
1431
from neo4j import ExperimentalWarning
1412
1432
1413
1433
warnings.filterwarnings(" ignore" , category = ExperimentalWarning)
1414
1434
1435
+ ...
1436
+
1415
1437
1416
1438
** *******
1417
1439
Bookmarks
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ Async API Documentation
10
10
This means everything documented on this page might be removed or change
11
11
its API at any time (including in patch releases).
12
12
13
+ (See :ref: `filter-warnings-ref `)
14
+
13
15
.. versionadded :: 5.0
14
16
15
17
******************
You can’t perform that action at this time.
0 commit comments