Improve topology map widget documentation#3755
Open
api-clients-generation-pipeline[bot] wants to merge 2 commits into
Open
Improve topology map widget documentation#3755api-clients-generation-pipeline[bot] wants to merge 2 commits into
api-clients-generation-pipeline[bot] wants to merge 2 commits into
Conversation
4bff6f6 to
98b2f1b
Compare
Two related deserialization bugs surfaced when parsing the topology_map and geomap dashboard widgets: - ModelNormal.set_attribute only propagated _unparsed from list elements that were UnparsedObject instances, missing nested OpenApiModel instances that were themselves _unparsed. A topology_map request whose query carried a mismatched data_source enum could ambiguously satisfy both oneOf variants without being flagged. - allows_single_value_input skipped list oneOf branches, returning False for a ModelComposed such as FormulaAndFunctionEventQueryGroupByConfig (oneOf of a group-by list or a flat fields object). deserialize_model then splatted a list input into positional args, crashing ModelComposed.__init__; the TypeError was swallowed during matching and masked the failure once _unparsed propagation was fixed. Propagate _unparsed from nested models in lists, and treat a list oneOf branch as allowing single-value input so list inputs route through get_oneof_instance. Applied to both the generated model_utils.py and the generator template.
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.
See DataDog/datadog-api-spec#5974 Test branch datadog-api-spec/test/adam.hooper/topology-widget-freshen-2
Behavior change
Solved two small parsing bugs:
oneOfmatched both branchesNow,
TopologyMapWidgetDefinitionDataStreamshas an attributerequestswith each child aTopologyRequestDataStreams. AndTopologyMapWidgetDefinitionServiceMaphas an attributerequestswith each childTopologyRequestServiceMap.When parsing a service-map widget, we test both branches:
TopologyMapWidgetDefinitionServiceMap=> succeeds, because itsrequestscontains a validTopologyRequestServiceMapTopologyMapWidgetDefinitionDataStreams=> succeeds in error, because itsrequestscontains an invalidTopologyRequestDataStreamsbut that_unparsedwasn't propagated to the list.Fix: propagate
_unparsedso the list is marked unparsed.Formula Events group-by lists failed to parse
#3230 (March 2026) introduced a regression: Formula Events group-by lists failed to parse.
What we wanted:
What we shipped:
This is because the parser wouldn't accept
oneOfwhere one branch is a list.But we didn't see this error because we weren't propagating
_unparsedcorrectly.Fix:
deserialize_model(): accept a list as a validoneOfchild.