-
Notifications
You must be signed in to change notification settings - Fork 54
FormulaAndFunctionQueryDefinition group_by is list of objects, not dicts #3768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,7 @@ def allows_single_value_input(cls): | |
| elif issubclass(cls, ModelComposed): | ||
| if not cls._composed_schemas["oneOf"]: | ||
| return False | ||
| return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"] if not isinstance(c, list)) | ||
| return any(isinstance(c, list) or allows_single_value_input(c) for c in cls._composed_schemas["oneOf"]) | ||
| return False | ||
|
|
||
|
|
||
|
|
@@ -181,7 +181,7 @@ def set_attribute(self, name, value): | |
| ) | ||
| if isinstance(value, list): | ||
| for x in value: | ||
| if isinstance(x, UnparsedObject): | ||
| if isinstance(x, UnparsedObject) or (isinstance(x, OpenApiModel) and x._unparsed): | ||
| self._unparsed = True | ||
| if name in self.validations: | ||
| check_validations(self.validations[name], name, value, self._configuration) | ||
|
|
@@ -1687,16 +1687,16 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): | |
| else: | ||
| if isinstance(oneof_class, list): | ||
| oneof_class = oneof_class[0] | ||
| list_oneof_instance = [] | ||
| if model_arg is None and not model_kwargs: | ||
| # Empty data | ||
| oneof_instances.append(list_oneof_instance) | ||
| oneof_instances.append([]) | ||
| continue | ||
|
|
||
| # Check if inner type is primitive - follows same pattern as complex objects: | ||
| # https://github.com/DataDog/datadog-api-client-python/blob/008536d34760ce096e118edc54df613d82194529/.generator/src/generator/templates/model_utils.j2#L1590-L1599 | ||
| if oneof_class in PRIMITIVE_TYPES: | ||
| # Handle list of primitives (e.g., [str], [float]) | ||
| list_oneof_instance = [] | ||
| for arg in model_arg: | ||
| oneof_instance = validate_and_convert_types( | ||
| arg, | ||
|
|
@@ -1707,28 +1707,22 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): | |
| configuration=constant_kwargs.get("_configuration"), | ||
| ) | ||
| list_oneof_instance.append(oneof_instance) | ||
| if list_oneof_instance: | ||
| oneof_instances.append(list_oneof_instance) | ||
| oneof_instances.append(list_oneof_instance) | ||
| elif inspect.isclass(oneof_class) and issubclass(oneof_class, ModelSimple): | ||
| # Handle list of ModelSimple | ||
| for arg in model_arg: | ||
| oneof_instance = oneof_class(arg, **constant_kwargs) | ||
| if not oneof_instance._unparsed: | ||
| list_oneof_instance.append(oneof_instance) | ||
| if list_oneof_instance: | ||
| list_oneof_instance = [oneof_class(arg, **constant_kwargs) for arg in model_arg] | ||
| if not any(item._unparsed for item in list_oneof_instance): | ||
| oneof_instances.append(list_oneof_instance) | ||
| else: | ||
| # Handle list of complex objects (ModelNormal, ModelComposed) | ||
| for arg in model_arg: | ||
| if constant_kwargs.get("_spec_property_naming"): | ||
| oneof_instance = oneof_class( | ||
| **change_keys_js_to_python(arg, oneof_class), **constant_kwargs | ||
| ) | ||
| else: | ||
| oneof_instance = oneof_class(**arg, **constant_kwargs) | ||
| if not oneof_instance._unparsed: | ||
| list_oneof_instance.append(oneof_instance) | ||
| if list_oneof_instance: | ||
| if constant_kwargs.get("_spec_property_naming"): | ||
| list_oneof_instance = [ | ||
| oneof_class(**change_keys_js_to_python(arg, oneof_class), **constant_kwargs) | ||
| for arg in model_arg | ||
| ] | ||
| else: | ||
| list_oneof_instance = [oneof_class(**arg, **constant_kwargs) for arg in model_arg] | ||
| if not any(item._unparsed for item in list_oneof_instance): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When Useful? React with 👍 / 👎. |
||
| oneof_instances.append(list_oneof_instance) | ||
| elif issubclass(oneof_class, ModelSimple): | ||
| if model_arg is not None: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.