Move imports in recorder component (#27859)
* move imports to top-level in recorder init * move imports to top-level in recorder migration * move imports to top-level in recorder models * move imports to top-level in recorder purge * move imports to top-level in recorder util * fix pylint
This commit is contained in:
parent
e95b8035ed
commit
83a709b768
6 changed files with 27 additions and 50 deletions
|
@ -15,6 +15,7 @@ from sqlalchemy import (
|
|||
distinct,
|
||||
)
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.core import Context, Event, EventOrigin, State, split_entity_id
|
||||
|
@ -164,8 +165,6 @@ class RecorderRuns(Base): # type: ignore
|
|||
Specify point_in_time if you want to know which existed at that point
|
||||
in time inside the run.
|
||||
"""
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
||||
session = Session.object_session(self)
|
||||
|
||||
assert session is not None, "RecorderRuns need to be persisted"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue