fix(eap): flatten nested attributes_array JSON for dotted keys#7911
Open
manessaraj wants to merge 3 commits intomasterfrom
Open
fix(eap): flatten nested attributes_array JSON for dotted keys#7911manessaraj wants to merge 3 commits intomasterfrom
manessaraj wants to merge 3 commits intomasterfrom
Conversation
ClickHouse can emit nested objects for dotted keys under toJSONString(attributes_array). Flatten that shape back to dotted attribute names before decoding tagged array elements. All parsing stays in process_arrays (common.py); bad JSON or structure raises BadSnubaRPCRequestException. fixes EXP-915
260fd78 to
c8d50c0
Compare
onewland
reviewed
Apr 28, 2026
|
|
||
|
|
||
| def _flatten_attributes_array_json(node: dict[str, Any], prefix: str = "") -> dict[str, list[Any]]: | ||
| """Flatten nested dicts into dotted keys (name -> list). ClickHouse often nests dotted paths.""" |
Contributor
There was a problem hiding this comment.
let's change this comment to say that ClickHouse stores all JSON objects as flat and interprets dotted paths in a special way to support nesting, then link to the relevant ClickHouse docs
kylemumma
approved these changes
Apr 28, 2026
Member
kylemumma
left a comment
There was a problem hiding this comment.
lgtm once you address olivers comment
|
|
||
|
|
||
| def transform_array_value(value: dict[str, str]) -> Any: | ||
| def transform_array_value(value: Any) -> Any: |
Member
There was a problem hiding this comment.
can you keep type as dict here instead of Any. (its not enforced at runtime so you can still keep your isinstance check)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClickHouse can emit nested objects for dotted keys under toJSONString(attributes_array). Flatten that shape back to dotted attribute names before decoding tagged array elements. All parsing stays in process_arrays (common.py); bad JSON or structure raises BadSnubaRPCRequestException.
fixes EXP-915