Skip to content
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

Remove unnecessary field in list stream column config #424

Merged
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-12 14:27:14.493663",
"spec_repo_commit": "3ebe762b"
"regenerated": "2024-12-12 15:23:50.266080",
"spec_repo_commit": "222e1f81"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-12 14:27:14.513351",
"spec_repo_commit": "3ebe762b"
"regenerated": "2024-12-12 15:23:50.285587",
"spec_repo_commit": "222e1f81"
}
}
}
5 changes: 0 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4654,11 +4654,6 @@ components:
description: Widget column field.
example: content
type: string
is_clustering_pattern_field_path:
description: Identifies the clustering pattern field column, usable only
with logs_pattern_stream.
example: true
type: boolean
width:
$ref: '#/components/schemas/ListStreamColumnWidth'
required:
Expand Down
3 changes: 1 addition & 2 deletions examples/v1_dashboards_CreateDashboard_1039800684.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ async fn main() {
vec![ListStreamWidgetRequest::new(
vec![
ListStreamColumn::new("timestamp".to_string(), ListStreamColumnWidth::AUTO),
ListStreamColumn::new("message".to_string(), ListStreamColumnWidth::AUTO)
.is_clustering_pattern_field_path(true),
ListStreamColumn::new("message".to_string(), ListStreamColumnWidth::AUTO),
],
ListStreamQuery::new(ListStreamSource::LOGS_PATTERN_STREAM, "".to_string())
.clustering_pattern_field_path("message".to_string())
Expand Down
18 changes: 0 additions & 18 deletions src/datadogV1/model/model_list_stream_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ pub struct ListStreamColumn {
/// Widget column field.
#[serde(rename = "field")]
pub field: String,
/// Identifies the clustering pattern field column, usable only with logs_pattern_stream.
#[serde(rename = "is_clustering_pattern_field_path")]
pub is_clustering_pattern_field_path: Option<bool>,
/// Widget column width.
#[serde(rename = "width")]
pub width: crate::datadogV1::model::ListStreamColumnWidth,
Expand All @@ -34,18 +31,12 @@ impl ListStreamColumn {
) -> ListStreamColumn {
ListStreamColumn {
field,
is_clustering_pattern_field_path: None,
width,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn is_clustering_pattern_field_path(mut self, value: bool) -> Self {
self.is_clustering_pattern_field_path = Some(value);
self
}

pub fn additional_properties(
mut self,
value: std::collections::BTreeMap<String, serde_json::Value>,
Expand Down Expand Up @@ -73,7 +64,6 @@ impl<'de> Deserialize<'de> for ListStreamColumn {
M: MapAccess<'a>,
{
let mut field: Option<String> = None;
let mut is_clustering_pattern_field_path: Option<bool> = None;
let mut width: Option<crate::datadogV1::model::ListStreamColumnWidth> = None;
let mut additional_properties: std::collections::BTreeMap<
String,
Expand All @@ -86,13 +76,6 @@ impl<'de> Deserialize<'de> for ListStreamColumn {
"field" => {
field = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"is_clustering_pattern_field_path" => {
if v.is_null() {
continue;
}
is_clustering_pattern_field_path =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"width" => {
width = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
if let Some(ref _width) = width {
Expand All @@ -116,7 +99,6 @@ impl<'de> Deserialize<'de> for ListStreamColumn {

let content = ListStreamColumn {
field,
is_clustering_pattern_field_path,
width,
additional_properties,
_unparsed,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-11-20T19:43:46.485Z
2024-12-11T19:18:02.796Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1732131826 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"is_clustering_pattern_field_path\":true,\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}",
"string": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1733944682 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}",
"encoding": null
},
"headers": {
Expand All @@ -19,7 +19,7 @@
},
"response": {
"body": {
"string": "{\"id\":\"r75-hd7-sd9\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1732131826 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/r75-hd7-sd9/test-createanewdashboardwithlogspatternstreamliststreamwidget-1732131826-with-li\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"is_clustering_pattern_field_path\":true,\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":6154246442450384}],\"notify_list\":null,\"created_at\":\"2024-11-20T19:43:46.871965+00:00\",\"modified_at\":\"2024-11-20T19:43:46.871965+00:00\",\"restricted_roles\":[]}\n",
"string": "{\"id\":\"fue-7tr-ubw\",\"title\":\"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1733944682 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/fue-7tr-ubw/test-createanewdashboardwithlogspatternstreamliststreamwidget-1733944682-with-li\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"message\",\"width\":\"auto\"}],\"query\":{\"clustering_pattern_field_path\":\"message\",\"data_source\":\"logs_pattern_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":4674889262305585}],\"notify_list\":null,\"created_at\":\"2024-12-11T19:18:03.039937+00:00\",\"modified_at\":\"2024-12-11T19:18:03.039937+00:00\",\"restricted_roles\":[]}\n",
"encoding": null
},
"headers": {
Expand All @@ -32,7 +32,7 @@
"message": "OK"
}
},
"recorded_at": "Wed, 20 Nov 2024 19:43:46 GMT"
"recorded_at": "Wed, 11 Dec 2024 19:18:02 GMT"
},
{
"request": {
Expand All @@ -43,11 +43,11 @@
]
},
"method": "delete",
"uri": "https://api.datadoghq.com/api/v1/dashboard/r75-hd7-sd9"
"uri": "https://api.datadoghq.com/api/v1/dashboard/fue-7tr-ubw"
},
"response": {
"body": {
"string": "{\"deleted_dashboard_id\":\"r75-hd7-sd9\"}\n",
"string": "{\"deleted_dashboard_id\":\"fue-7tr-ubw\"}\n",
"encoding": null
},
"headers": {
Expand All @@ -60,7 +60,7 @@
"message": "OK"
}
},
"recorded_at": "Wed, 20 Nov 2024 19:43:46 GMT"
"recorded_at": "Wed, 11 Dec 2024 19:18:02 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/scenarios/features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ Feature: Dashboards
@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with logs_pattern_stream list_stream widget
Given new "CreateDashboard" request
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"},{"width":"auto","field":"message", "is_clustering_pattern_field_path": true}],"query":{"data_source":"logs_pattern_stream","query_string":"","clustering_pattern_field_path":"message","group_by":[{"facet":"service"}]}, "response_format":"event_list"}]}}]}
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"},{"width":"auto","field":"message"}],"query":{"data_source":"logs_pattern_stream","query_string":"","clustering_pattern_field_path":"message","group_by":[{"facet":"service"}]}, "response_format":"event_list"}]}}]}
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_pattern_stream"
Expand Down
Loading