Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MLOP-2519): avoid configuring logger at lib level #393

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions butterfree/_cli/migrate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import importlib
import inspect
import logging
import os
import pkgutil
import sys
Expand All @@ -12,15 +13,14 @@
from botocore.exceptions import ClientError

from butterfree.configs import environment
from butterfree.configs.logger import __logger
from butterfree.migrations.database_migration import ALLOWED_DATABASE
from butterfree.pipelines import FeatureSetPipeline

app = typer.Typer(
help="Apply the automatic migrations in a database.", no_args_is_help=True
)

logger = __logger("migrate", True)
logger = logging.getLogger(__name__)


def __find_modules(path: str) -> Set[str]:
Expand Down
4 changes: 2 additions & 2 deletions butterfree/clients/cassandra_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""CassandraClient entity."""

import logging
from ssl import CERT_REQUIRED, PROTOCOL_TLSv1
from typing import Dict, List, Optional, Union

Expand All @@ -16,9 +17,8 @@
from typing_extensions import TypedDict

from butterfree.clients import AbstractClient
from butterfree.configs.logger import __logger

logger = __logger("cassandra_client")
logger = logging.getLogger(__name__)

EMPTY_STRING_HOST_ERROR = "The value of Cassandra host is empty. Please fill correctly with your endpoints" # noqa: E501
GENERIC_INVALID_HOST_ERROR = "The Cassandra host must be a valid string, a string that represents a list or list of strings" # noqa: E501
Expand Down
24 changes: 0 additions & 24 deletions butterfree/configs/logger.py

This file was deleted.

5 changes: 3 additions & 2 deletions butterfree/load/writers/delta_writer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import logging

from delta.tables import DeltaTable
from pyspark.sql.dataframe import DataFrame

from butterfree.clients import SparkClient
from butterfree.configs.logger import __logger

logger = __logger("delta_writer", True)
logger = logging.getLogger(__name__)


class DeltaWriter:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""Migration entity."""

import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum, auto
from typing import Any, Dict, List, Optional, Set

from butterfree.clients import AbstractClient
from butterfree.configs.logger import __logger
from butterfree.load.writers.writer import Writer
from butterfree.transform import FeatureSet

logger = __logger("database_migrate", True)
logger = logging.getLogger(__name__)


@dataclass
Expand Down
Loading