feat: log decorator util - adding automatic logs out of the box (#18620)

* feat: add logger utils

* fix bad definitions of under_info and debug_enable

* fix pre-commit
This commit is contained in:
ofekisr
2022-02-08 18:38:57 +02:00
committed by GitHub
parent cdfcbbaf30
commit 41f3c95345
3 changed files with 178 additions and 9 deletions

View File

@@ -14,15 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from __future__ import annotations
from abc import ABC, abstractmethod
@@ -31,6 +22,7 @@ from typing import Dict, Optional, TYPE_CHECKING
from pandas import DataFrame
from sqlalchemy.inspection import inspect
from tests.common.logger_utils import log
from tests.example_data.data_loading.base_data_loader import DataLoader
if TYPE_CHECKING:
@@ -42,6 +34,7 @@ if TYPE_CHECKING:
)
@log
class PandasDataLoader(DataLoader):
_db_engine: Engine
_configurations: PandasLoaderConfigurations

View File

@@ -20,12 +20,14 @@ from typing import Optional, TYPE_CHECKING
from pandas import DataFrame
from tests.common.logger_utils import log
from tests.example_data.data_loading.pandas.pandas_data_loader import TableToDfConvertor
if TYPE_CHECKING:
from tests.example_data.data_loading.data_definitions.types import Table
@log
class TableToDfConvertorImpl(TableToDfConvertor):
convert_datetime_to_str: bool
_time_format: Optional[str]