Skip to content

Commit

Permalink
fix: align add records parameters with render function
Browse files Browse the repository at this point in the history
  • Loading branch information
burtenshaw committed Jun 27, 2024
1 parent 07aa249 commit 8a6d484
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions argilla/src/argilla/records/_dataset_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _validate_vector_names(self, vector_names: Union[List[str], str]) -> None:

def _render_record_mapping(
self,
records: List[Dict[str, Any]],
data: Dict[str, Any],
mapping: Optional[Dict[str, Union[str, Sequence[str]]]] = None,
) -> Dict[str, Tuple[Optional[str]]]:
"""Renders a mapping from a list of records and a mapping dictionary, to a singular mapping dictionary."""
Expand All @@ -425,7 +425,7 @@ def _render_record_mapping(
singular_mapping = defaultdict(dict)

# update the mapping with unmapped columns
for key, value in records[0].items():
for key, value in data.items():
if key not in schema and key not in mapping:
warnings.warn(
message=f"Record attribute {key} is not in the schema so skipping.",
Expand Down Expand Up @@ -491,7 +491,7 @@ def _infer_record_from_mapping(
"""

mapping = self._render_record_mapping(records=records, mapping=mapping)
mapping = self._render_record_mapping(data=data, mapping=mapping)
id_mapping = mapping.get("id", {})
suggestion_mapping = mapping.get("suggestion", {})
response_mapping = mapping.get("response", {})
Expand Down

0 comments on commit 8a6d484

Please sign in to comment.