ruff lint

This commit is contained in:
Manoj Aggarwal 2026-01-09 13:38:49 -08:00
parent 29dadfd138
commit 62d0d8b6db
2 changed files with 8 additions and 6 deletions

View file

@ -2,6 +2,8 @@
Microsoft Teams connector indexer.
"""
from datetime import UTC
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.asyncio import AsyncSession
@ -165,16 +167,16 @@ async def index_teams_messages(
)
# Convert date strings to datetime objects for filtering
from datetime import datetime, timezone
from datetime import datetime
start_datetime = None
end_datetime = None
if start_date_str:
# Parse as naive datetime and make it timezone-aware (UTC)
start_datetime = datetime.strptime(start_date_str, "%Y-%m-%d").replace(tzinfo=timezone.utc)
start_datetime = datetime.strptime(start_date_str, "%Y-%m-%d").replace(tzinfo=UTC)
if end_date_str:
# Parse as naive datetime, set to end of day, and make it timezone-aware (UTC)
end_datetime = datetime.strptime(end_date_str, "%Y-%m-%d").replace(hour=23, minute=59, second=59, tzinfo=timezone.utc)
end_datetime = datetime.strptime(end_date_str, "%Y-%m-%d").replace(hour=23, minute=59, second=59, tzinfo=UTC)
# Process each team
for team in teams: