Skip to content

Commit

Permalink
Pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sydp committed Mar 7, 2024
1 parent d1338f1 commit 91edd8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dftimewolf/lib/processors/llm_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from dftimewolf.lib import logging_utils
from dftimewolf.lib import module
from dftimewolf.lib import state
from dftimewolf.lib import state_lib
from dftimewolf.lib.containers import containers


Expand All @@ -25,7 +25,7 @@ class LLMProcessorBase(module.BaseModule):

def __init__(
self,
state: state.DFTimewolfState,
state: state_lib.DFTimewolfState,
logger: logging_utils.WolfLogger,
name: Optional[str] = None,
critical: bool = False,
Expand Down Expand Up @@ -68,7 +68,7 @@ def SetUp(self, task: str, model_name: str, columns_to_process: str) -> None:
self.model_name = model_name

self.columns_to_process = [x for x in columns_to_process.split(',') if x]
if not len(self.columns_to_process):
if len(self.columns_to_process) == 0:
self.ModuleError('No columns to process', critical=True)

def _ProcessDataFrame(self, dataframe: pd.DataFrame) -> None:
Expand All @@ -81,7 +81,7 @@ def _ProcessDataFrame(self, dataframe: pd.DataFrame) -> None:
dataframe: the Pandas dataframe to process.
Raises:
ValueError if the dataframe does not contain the specified columns.
ValueError: if the dataframe does not contain the specified columns.
"""
if not set(dataframe.columns).issuperset(self.columns_to_process):
raise ValueError(
Expand Down
7 changes: 3 additions & 4 deletions tests/lib/processors/llm_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

from dftimewolf import config
from dftimewolf.lib.containers import containers
from dftimewolf.lib import module
from dftimewolf.lib import state
from dftimewolf.lib import state_lib
from dftimewolf.lib import errors
from dftimewolf.lib.processors import llm_base
from dftimewolf.lib.logging_utils import WolfLogger
Expand All @@ -18,7 +17,7 @@ class LLMProcessorBaseTest(unittest.TestCase):
def setUp(self):
"""Tests that the processor can be initialized."""
#self.logger = WolfLogger('test')
self.test_state = state.DFTimewolfState(config.Config)
self.test_state = state_lib.DFTimewolfState(config.Config)
self.logger = WolfLogger(name='test logger')

def testInitialization(self):
Expand All @@ -37,7 +36,7 @@ def testSetUp(self):
state=self.test_state, logger=self.logger)
with self.assertRaisesRegex(
errors.DFTimewolfError,
r'is not supported by the LLM processor') as error:
r'is not supported by the LLM processor'):
llm_base_processor.SetUp(
'unknown', model_name='unknown', columns_to_process='a,b,c')

Expand Down

0 comments on commit 91edd8c

Please sign in to comment.