File tree 1 file changed +22
-0
lines changed 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1346,13 +1346,35 @@ Filter Warnings
1346
1346
1347
1347
This example shows how to suppress the :class :`neo4j.ExperimentalWarning` using the :func:`python:warnings.filterwarnings` function.
1348
1348
1349
+ .. code- block:: python
1350
+
1351
+ import warnings
1352
+ from neo4j import ExperimentalWarning
1353
+
1354
+ ...
1355
+
1356
+ with warnings.catch_warnings():
1357
+ warnings.filterwarnings(" ignore" , category = ExperimentalWarning)
1358
+ ... # the call emitting the ExperimentalWarning
1359
+
1360
+ ...
1361
+
1362
+ This will only mute the :class :`neo4j.ExperimentalWarning` for everything inside
1363
+ the `` with `` - block. This is the preferred way to mute warnings, as warnings
1364
+ triggerd by new code will still be visible.
1365
+
1366
+ However, should you want to mute it for the entire application, use the
1367
+ following code:
1368
+
1349
1369
.. code- block:: python
1350
1370
1351
1371
import warnings
1352
1372
from neo4j import ExperimentalWarning
1353
1373
1354
1374
warnings.filterwarnings(" ignore" , category = ExperimentalWarning)
1355
1375
1376
+ ...
1377
+
1356
1378
1357
1379
** ******
1358
1380
Bookmark
You can’t perform that action at this time.
0 commit comments