Skip to content

fix(datasets): hydrate media under numeric object keys - #2108

Open
Aafimalek wants to merge 1 commit into
langfuse:mainfrom
Aafimalek:fix/dataset-numeric-media
Open

Aafimalek wants to merge 1 commit into
langfuse:mainfrom
Aafimalek:fix/dataset-numeric-media

Conversation

@Aafimalek

@Aafimalek Aafimalek commented Nov 6, 2026 •

Copy link
Copy Markdown

What does this PR do?

Dataset media references under numeric object keys are left as raw strings when the Python SDK loads a dataset. The backend's jsonpath-plus emits $[0] for both an array index and an object key "0"; it emits $[00] for the distinct object key "00".

Resolve numeric segments according to the current container and preserve leading zeroes. Missing object keys still raise instead of creating a new entry. Existing array indices continue to use integers.

The regression tests cover numeric keys at leaf and intermediate positions, leading zeroes, mixed arrays and objects, and the dataset hydration path. I confirmed the examples against the backend's jsonpath-plus 10.3.0. There is no linked issue for this independently reproduced bug.

Type of change

  • Bug fix

Verification

python -m pytest -q tests/unit/test_json_path.py tests/unit/test_datasets.py
python -m pytest -n 4 --dist worksteal tests/unit
ruff check .
ruff format --check .
mypy langfuse --no-error-summary

The affected tests reproduced failed hydration before the fix. Afterward, 38 focused tests and 1,021 unit tests passed; 2 unit tests were skipped. The first broad run timed out in the prompt-shutdown test during concurrent checks. That test and the full suite passed on a rerun with the project environment on PATH. Live provider and server-backed E2E tests were not run.

Checklist

  • Diff reviewed against code_review.md.
  • Regression tests added for behavior changes.
  • Generated files and credentials excluded from the diff.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Fixes dataset media references under numeric object keys.

  • Dataset items hydrate media under numeric object keys.

Reviews (1) · Last reviewed commit: "fix(datasets): hydrate media under numer..." · Reviewed by Greptile

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant