Skip to content

Commit

Permalink
[FIX] Add from_dict method to Entidad class for API compatibility
Browse files Browse the repository at this point in the history
- Add from_dict classmethod to Entidad for proper data mapping
- Update get_entidades to use from_dict instead of direct kwargs
- Fix API response field mapping from 'codigoEntidad' to 'codigo_entidad'
- Maintain consistency with project's data model patterns
See also: #28
  • Loading branch information
PPeitsch committed Dec 19, 2024
1 parent b91d7a9 commit 36695ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bcra_connector/bcra_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def get_entidades(self) -> List[Entidad]:
self.logger.info("Fetching financial entities")
try:
data = self._make_request("cheques/v1.0/entidades")
entities = [Entidad(**e) for e in data["results"]]
entities = [Entidad.from_dict(e) for e in data["results"]]
self.logger.info(f"Successfully fetched {len(entities)} entities")
return entities
except KeyError as e:
Expand Down

0 comments on commit 36695ac

Please sign in to comment.