Skip to content

Extend Widget time schema with support for hide_incomplete_cost_data #2793

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "1e6c346",
"generated": "2025-08-25 18:45:46.784"
"spec_repo_commit": "93387ae",
"generated": "2025-08-26 20:03:23.993"
}
9 changes: 9 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24160,6 +24160,9 @@ components:
additionalProperties: false
description: Wrapper for live span
properties:
hide_incomplete_cost_data:
description: Whether to hide incomplete cost data in the widget.
type: boolean
live_span:
$ref: '#/components/schemas/WidgetLiveSpan'
type: object
Expand Down Expand Up @@ -24360,6 +24363,9 @@ components:
format: int64
minimum: 0
type: integer
hide_incomplete_cost_data:
description: Whether to hide incomplete cost data in the widget.
type: boolean
to:
description: End time in seconds since epoch.
example: 1712083128
Expand All @@ -24384,6 +24390,9 @@ components:
WidgetNewLiveSpan:
description: Used for arbitrary live span times, such as 17 minutes or 6 hours.
properties:
hide_incomplete_cost_data:
description: Whether to hide incomplete cost data in the widget.
type: boolean
type:
$ref: '#/components/schemas/WidgetNewLiveSpanType'
unit:
Expand Down
1 change: 1 addition & 0 deletions examples/v1/dashboards/CreateDashboard_3066042014.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
type=WidgetNewLiveSpanType.LIVE,
unit=WidgetLiveSpanUnit.MINUTE,
value=8,
hide_incomplete_cost_data=True,
),
type=TimeseriesWidgetDefinitionType.TIMESERIES,
requests=[
Expand Down
1 change: 1 addition & 0 deletions examples/v1/dashboards/CreateDashboard_3451918078.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
type=WidgetNewFixedSpanType.FIXED,
_from=1712080128,
to=1712083128,
hide_incomplete_cost_data=True,
),
type=TimeseriesWidgetDefinitionType.TIMESERIES,
requests=[
Expand Down
1 change: 1 addition & 0 deletions examples/v1/dashboards/CreateDashboard_4262729673.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
],
time=WidgetLegacyLiveSpan(
live_span=WidgetLiveSpan.PAST_FIVE_MINUTES,
hide_incomplete_cost_data=True,
),
type=TimeseriesWidgetDefinitionType.TIMESERIES,
requests=[
Expand Down
14 changes: 13 additions & 1 deletion src/datadog_api_client/v1/model/widget_legacy_live_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,32 @@ def openapi_types(_):
from datadog_api_client.v1.model.widget_live_span import WidgetLiveSpan

return {
"hide_incomplete_cost_data": (bool,),
"live_span": (WidgetLiveSpan,),
}

attribute_map = {
"hide_incomplete_cost_data": "hide_incomplete_cost_data",
"live_span": "live_span",
}

def __init__(self_, live_span: Union[WidgetLiveSpan, UnsetType] = unset, **kwargs):
def __init__(
self_,
hide_incomplete_cost_data: Union[bool, UnsetType] = unset,
live_span: Union[WidgetLiveSpan, UnsetType] = unset,
**kwargs,
):
"""
Wrapper for live span

:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
:type hide_incomplete_cost_data: bool, optional

:param live_span: The available timeframes depend on the widget you are using.
:type live_span: WidgetLiveSpan, optional
"""
if hide_incomplete_cost_data is not unset:
kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data
if live_span is not unset:
kwargs["live_span"] = live_span
super().__init__(kwargs)
20 changes: 18 additions & 2 deletions src/datadog_api_client/v1/model/widget_new_fixed_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


Expand All @@ -31,29 +33,43 @@ def openapi_types(_):

return {
"_from": (int,),
"hide_incomplete_cost_data": (bool,),
"to": (int,),
"type": (WidgetNewFixedSpanType,),
}

attribute_map = {
"_from": "from",
"hide_incomplete_cost_data": "hide_incomplete_cost_data",
"to": "to",
"type": "type",
}

def __init__(self_, _from: int, to: int, type: WidgetNewFixedSpanType, **kwargs):
def __init__(
self_,
_from: int,
to: int,
type: WidgetNewFixedSpanType,
hide_incomplete_cost_data: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
Used for fixed span times, such as 'March 1 to March 7'.

:param _from: Start time in seconds since epoch.
:type _from: int

:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
:type hide_incomplete_cost_data: bool, optional

:param to: End time in seconds since epoch.
:type to: int

:param type: Type "fixed" denotes a fixed span.
:type type: WidgetNewFixedSpanType
"""
if hide_incomplete_cost_data is not unset:
kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data
super().__init__(kwargs)

self_._from = _from
Expand Down
20 changes: 18 additions & 2 deletions src/datadog_api_client/v1/model/widget_new_live_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


Expand All @@ -29,21 +31,33 @@ def openapi_types(_):
from datadog_api_client.v1.model.widget_live_span_unit import WidgetLiveSpanUnit

return {
"hide_incomplete_cost_data": (bool,),
"type": (WidgetNewLiveSpanType,),
"unit": (WidgetLiveSpanUnit,),
"value": (int,),
}

attribute_map = {
"hide_incomplete_cost_data": "hide_incomplete_cost_data",
"type": "type",
"unit": "unit",
"value": "value",
}

def __init__(self_, type: WidgetNewLiveSpanType, unit: WidgetLiveSpanUnit, value: int, **kwargs):
def __init__(
self_,
type: WidgetNewLiveSpanType,
unit: WidgetLiveSpanUnit,
value: int,
hide_incomplete_cost_data: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
Used for arbitrary live span times, such as 17 minutes or 6 hours.

:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
:type hide_incomplete_cost_data: bool, optional

:param type: Type "live" denotes a live span in the new format.
:type type: WidgetNewLiveSpanType

Expand All @@ -53,6 +67,8 @@ def __init__(self_, type: WidgetNewLiveSpanType, unit: WidgetLiveSpanUnit, value
:param value: Value of the time span.
:type value: int
"""
if hide_incomplete_cost_data is not unset:
kwargs["hide_incomplete_cost_data"] = hide_incomplete_cost_data
super().__init__(kwargs)

self_.type = type
Expand Down
3 changes: 3 additions & 0 deletions src/datadog_api_client/v1/model/widget_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def __init__(self, **kwargs):
"""
Time setting for the widget.

:param hide_incomplete_cost_data: Whether to hide incomplete cost data in the widget.
:type hide_incomplete_cost_data: bool, optional

:param live_span: The available timeframes depend on the widget you are using.
:type live_span: WidgetLiveSpan, optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-15T19:33:02.539Z
2025-08-26T19:47:58.449Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182
with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"}}]}'
body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678
with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"}}]}'
headers:
accept:
- application/json
Expand All @@ -11,10 +11,9 @@ interactions:
uri: https://api.datadoghq.com/api/v1/dashboard
response:
body:
string: '{"id":"3zr-n9a-dfd","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182
with legacy live span time","description":null,"author_handle":"[email protected]","author_name":null,"layout_type":"ordered","url":"/dashboard/3zr-n9a-dfd/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1731699182-with-lega","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"},"id":5376392318113781}],"notify_list":null,"created_at":"2024-11-15T19:33:02.697929+00:00","modified_at":"2024-11-15T19:33:02.697929+00:00","reflow_type":"auto","restricted_roles":[]}

'
string: '{"id":"wek-eci-qnn","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678
with legacy live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
Account","layout_type":"ordered","url":"/dashboard/wek-eci-qnn/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1756237678-with-lega","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"},"id":3088384387119347}],"notify_list":null,"created_at":"2025-08-26T19:47:58.616519+00:00","modified_at":"2025-08-26T19:47:58.616519+00:00","reflow_type":"auto","restricted_roles":[]}'
headers:
content-type:
- application/json
Expand All @@ -27,10 +26,10 @@ interactions:
accept:
- application/json
method: DELETE
uri: https://api.datadoghq.com/api/v1/dashboard/3zr-n9a-dfd
uri: https://api.datadoghq.com/api/v1/dashboard/wek-eci-qnn
response:
body:
string: '{"deleted_dashboard_id":"3zr-n9a-dfd"}
string: '{"deleted_dashboard_id":"wek-eci-qnn"}

'
headers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-15T19:33:02.942Z
2025-08-26T19:47:58.908Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1731699182
with new fixed span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"}}]}'
body: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1756237678
with new fixed span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"hide_incomplete_cost_data":true,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"}}]}'
headers:
accept:
- application/json
Expand All @@ -11,10 +11,9 @@ interactions:
uri: https://api.datadoghq.com/api/v1/dashboard
response:
body:
string: '{"id":"xfq-c2m-cqi","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1731699182
with new fixed span time","description":null,"author_handle":"[email protected]","author_name":null,"layout_type":"ordered","url":"/dashboard/xfq-c2m-cqi/test-createanewtimeserieswidgetwithnewfixedspantimeformat-1731699182-with-new-fi","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"},"id":7353899445937131}],"notify_list":null,"created_at":"2024-11-15T19:33:03.107998+00:00","modified_at":"2024-11-15T19:33:03.107998+00:00","reflow_type":"auto","restricted_roles":[]}

'
string: '{"id":"43b-7uw-9hv","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1756237678
with new fixed span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
Account","layout_type":"ordered","url":"/dashboard/43b-7uw-9hv/test-createanewtimeserieswidgetwithnewfixedspantimeformat-1756237678-with-new-fi","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"hide_incomplete_cost_data":true,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"},"id":7908755715912813}],"notify_list":null,"created_at":"2025-08-26T19:47:59.063106+00:00","modified_at":"2025-08-26T19:47:59.063106+00:00","reflow_type":"auto","restricted_roles":[]}'
headers:
content-type:
- application/json
Expand All @@ -27,10 +26,10 @@ interactions:
accept:
- application/json
method: DELETE
uri: https://api.datadoghq.com/api/v1/dashboard/xfq-c2m-cqi
uri: https://api.datadoghq.com/api/v1/dashboard/43b-7uw-9hv
response:
body:
string: '{"deleted_dashboard_id":"xfq-c2m-cqi"}
string: '{"deleted_dashboard_id":"43b-7uw-9hv"}

'
headers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-15T19:33:03.421Z
2025-08-26T19:47:59.336Z
Loading
Loading