Conversation
Atlas API responses can return non-string scalars for these fields:
- default_value: native bool/int (e.g. false, 0) where str was expected
- index_type_es_fields values: int (e.g. {"ignore_above": 256}) where str was expected
msgspec strict=False does not coerce int/bool -> str, causing
ValidationError on live typedef responses. Widening to Any lets the
decoder accept whatever the API returns without pre-decode traversal.
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.
Summary
default_value: widened fromstr | None | UNSETtoAny | None | UNSETindex_type_es_fields: widened fromDict[str, Dict[str, str]] | None | UNSETtoDict[str, Dict[str, Any]] | None | UNSETWhy
The live Atlas API returns non-string scalars for both fields:
default_valuecan be a native JSON boolean (false) or integer (0) wherestrwas previously declaredindex_type_es_fieldsinner values can be integers (e.g.{"ignore_above": 256}) wherestrwas previously declaredmsgspecwithstrict=Falsedoes not coerceint/bool→str, so any consumer decoding a live Atlas typedef response would hit aValidationError. The only workaround was a deep JSON traversal before decoding — widening toAnyeliminates that entirely.Test plan
default_value: false/index_type_es_fields: {"ignore_above": 256}no longer raisesValidationErrorNote
Low Risk
Low risk: only broadens type annotations for typedef decoding to accept non-string JSON scalars/values; behavior is otherwise unchanged aside from allowing more payloads to deserialize without errors.
Overview
Relaxes
AttributeDefdecoding inpyatlan_v9/model/typedef.pyto match live Atlas API payloads.default_valueis widened fromstrtoAny, andindex_type_es_fieldsis widened so inner field values can beAny(not juststr), preventingmsgspecValidationErrors when the API returns booleans/integers (for examplefalseor{"ignore_above": 256}).Written by Cursor Bugbot for commit 3346805. This will update automatically on new commits. Configure here.