Skip to content

Commit

Permalink
fix: AbstractSQLRepository().get() must send a dict to prepare_data_f…
Browse files Browse the repository at this point in the history
…or_entity()
  • Loading branch information
eykd committed Jan 27, 2024
1 parent c887a58 commit cbe75bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/steerage/repositories/sqldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ async def get(self, id: UUIDorStr) -> TEntity:
except NoResultFound as exc:
raise self.NotFound(id) from exc
else:
return self.transform_data_to_entity(data)
return self.transform_data_to_entity(data._asdict())

async def insert(self, obj: TEntity) -> None:
"""Insert an entity into the repository.
Expand Down Expand Up @@ -290,7 +290,7 @@ async def update_attrs(self, id: UUIDorStr, **kwargs) -> None:

def prepare_data_for_entity(self, data: Row) -> Mapping:
"""Template method: transform stored data into entity-ready data."""
return data._asdict()
return data


class AwareDateTime(sa.types.TypeDecorator):
Expand Down

0 comments on commit cbe75bd

Please sign in to comment.