Skip to content

Commit f48c3cd

Browse files
committed
Supress pydantic user-warnings
1 parent d3bf3ae commit f48c3cd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

services/adgs/rs_server_adgs/fastapi/adgs_app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Init the FastAPI application."""
1616

17+
import warnings
18+
1719
# Import the database table modules before initializing the FastAPI,
1820
# that will init the database session and create the tables.
1921
# pylint: disable=unused-import, import-outside-toplevel
@@ -24,6 +26,9 @@
2426
from rs_server_adgs.fastapi.adgs_routers import adgs_routers
2527
from rs_server_common.fastapi_app import init_app
2628

29+
warnings.simplefilter("ignore", UserWarning) # Used to supress pydatinc userwarnings related to serialization
30+
31+
2732
# Init the FastAPI application with the adgs routers.
2833
app = init_app(__version__, adgs_routers, init_db=True, router_prefix="/auxip")
2934

services/cadip/rs_server_cadip/fastapi/cadip_app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Init the FastAPI application."""
1616

17+
import warnings
18+
1719
# Import the database table modules before initializing the FastAPI,
1820
# that will init the database session and create the tables.
1921
# pylint: disable=unused-import, import-outside-toplevel
@@ -24,6 +26,8 @@
2426
from rs_server_cadip.fastapi.cadip_routers import cadip_routers
2527
from rs_server_common.fastapi_app import init_app
2628

29+
warnings.simplefilter("ignore", UserWarning) # Used to supress pydatinc userwarnings related to serialization
30+
2731
# Init the FastAPI application with the cadip routers.
2832
app = init_app(__version__, cadip_routers, init_db=True, router_prefix="/cadip")
2933

0 commit comments

Comments
 (0)