Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
This commit is contained in:
parent
d85222ad80
commit
7d3c974747
28 changed files with 89 additions and 80 deletions
|
@ -659,9 +659,9 @@ class GTFSDepartureSensor(Entity):
|
|||
@staticmethod
|
||||
def dict_for_table(resource: Any) -> dict:
|
||||
"""Return a dictionary for the SQLAlchemy resource given."""
|
||||
return dict(
|
||||
(col, getattr(resource, col)) for col in resource.__table__.columns.keys()
|
||||
)
|
||||
return {
|
||||
col: getattr(resource, col) for col in resource.__table__.columns.keys()
|
||||
}
|
||||
|
||||
def append_keys(self, resource: dict, prefix: Optional[str] = None) -> None:
|
||||
"""Properly format key val pairs to append to attributes."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue