Skip to content

Commit c46d1d9

Browse files
authored
move the filterwarning to appropriate file (#3952)
1 parent 2223765 commit c46d1d9

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

reflex/components/component.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import copy
66
import typing
7-
import warnings
87
from abc import ABC, abstractmethod
98
from functools import lru_cache, wraps
109
from hashlib import md5
@@ -170,8 +169,6 @@ def evaluate_style_namespaces(style: ComponentStyle) -> dict:
170169
]
171170
ComponentChild = Union[types.PrimitiveType, Var, BaseComponent]
172171

173-
warnings.filterwarnings("ignore", message="fields may not start with an underscore")
174-
175172

176173
class Component(BaseComponent, ABC):
177174
"""A component with style, event trigger and other props."""

reflex/vars/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import re
1414
import string
1515
import sys
16+
import warnings
1617
from types import CodeType, FunctionType
1718
from typing import (
1819
TYPE_CHECKING,
@@ -72,6 +73,8 @@
7273

7374
VAR_TYPE = TypeVar("VAR_TYPE", covariant=True)
7475

76+
warnings.filterwarnings("ignore", message="fields may not start with an underscore")
77+
7578

7679
@dataclasses.dataclass(
7780
eq=False,

0 commit comments

Comments
 (0)