Skip to content

Commit

Permalink
Fixes for typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager committed Jul 17, 2024
1 parent 740a900 commit 8df52bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dftimewolf/lib/collectors/gcp_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(self,
self._project_name = ''
self._backoff = False
self._delay = 0
self.start_time = None
self.end_time = None
self.start_time: Optional[datetime.datetime] = None
self.end_time: Optional[datetime.datetime] = None

def OutputFile(self) -> Tuple[Any, str]:
"""Generate an output file name and path"""
Expand Down
2 changes: 1 addition & 1 deletion dftimewolf/lib/validators/datetime_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _EnsureTimezone(
# If there's no timezone information, we assume it is UTC.
if (parsed_datetime.tzinfo is None or
parsed_datetime.tzinfo.utcoffset(parsed_datetime) is None):
parsed_datetime = parsed_datetime.replace(tzinfo=datetime.UTC)
parsed_datetime = parsed_datetime.replace(tzinfo=datetime.timezone.utc)
return parsed_datetime

def Validate(self, argument_value: Any,
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/args_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class CommaSeparatedValidatorTest(unittest.TestCase):
"""Tests CommaSeparatedValidator."""

def testInit(self):
def testInit(self) -> None:
"""Tests initialization.
Really, CommaSeparatedValidator is an abstract class so should never be
Expand All @@ -29,7 +29,7 @@ def testInit(self):
mock_init.assert_called_once()
# pylint: enable=unused-variable

def testValidate(self):
def testValidate(self) -> None:
"""Tests validation."""
args_validator.CommaSeparatedValidator.__abstractmethods__=set()

Expand Down Expand Up @@ -63,7 +63,7 @@ def testValidate(self):
self.assertEqual(mock_validatesingle.call_count, 1)
self.assertEqual(val, 'one,two,three')

def testValidateFailure(self):
def testValidateFailure(self) -> None:
"""Tests validation failure."""
def FailingValidateSingle(argument_value, _):
if argument_value == 'three':
Expand Down

0 comments on commit 8df52bf

Please sign in to comment.