Describe the bug
In the file https://github.com/keephq/keep/blob/main/keep/api/core/db.py we have 2 definitions of the same function:
def get_incident_by_id(incident_id: UUID) -> Incident:
with Session(engine) as session:
incident = session.exec(
select(Incident)
.options(selectinload(Incident.alerts))
.where(Incident.id == incident_id)
).first()
return incident
def get_incident_by_id(tenant_id: str, incident_id: str) -> Optional[Incident]:
with Session(engine) as session:
query = session.query(
Incident,
).filter(
Incident.tenant_id == tenant_id,
Incident.id == incident_id,
)
return query.first()
First of them is not used (and can't be used) by any other code and I guess could/should be removed
To Reproduce
Observe it in https://github.com/keephq/keep/blob/main/keep/api/core/db.py
Describe the bug
In the file https://github.com/keephq/keep/blob/main/keep/api/core/db.py we have 2 definitions of the same function:
First of them is not used (and can't be used) by any other code and I guess could/should be removed
To Reproduce
Observe it in https://github.com/keephq/keep/blob/main/keep/api/core/db.py