Skip to content

Preserve JSON-like string parameters#28

Merged
adsharma merged 1 commit into
mainfrom
fix/json-like-string-params
Jun 9, 2026
Merged

Preserve JSON-like string parameters#28
adsharma merged 1 commit into
mainfrom
fix/json-like-string-params

Conversation

@adsharma

@adsharma adsharma commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Fixes: LadybugDB/ladybug#580

Summary

  • stop pybind parameter binding from auto-parsing strings that look like JSON
  • add a regression test for JSON-like strings stored in STRING columns

Root cause

The pybind parameter conversion path parsed Python strings starting with { or [ as JSON, which changed plain str parameters into nested values before assignment. When coerced back to STRING, JSON spelling and nulls were not preserved.

Validation

  • make build-pybind-subdir LBUG_SOURCE_DIR=../ladybug
  • uv run pytest test/test_parameter.py::test_json_like_string_param_round_trips_as_string -q
  • uv run pytest -q
  • LBUG_PYTHON_BACKEND=capi uv run pytest test/test_parameter.py::test_json_like_string_param_round_trips_as_string -q

@adsharma adsharma marked this pull request as ready for review June 9, 2026 03:48
@adsharma adsharma merged commit 86b06c4 into main Jun 9, 2026
2 checks passed
@adsharma adsharma deleted the fix/json-like-string-params branch June 9, 2026 03:49
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.

Bug: Python 0.16.1: a STRING parameter whose value starts with {/[ is silently coerced to STRUCT (lossy); regression from 0.15.3

1 participant