Skip to content

[DEX-114] add custom extent prop for geomap widget #2602

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
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": "2025-06-06 14:53:22.275829",
"spec_repo_commit": "e591d5d4"
"regenerated": "2025-06-06 17:05:55.639965",
"spec_repo_commit": "b8f8eb97"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-06 14:53:22.290847",
"spec_repo_commit": "e591d5d4"
"regenerated": "2025-06-06 17:05:55.654783",
"spec_repo_commit": "b8f8eb97"
}
}
}
16 changes: 16 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,22 @@ components:
example:
focus: WORLD
properties:
custom_extent:
description: A custom extent of the map defined by an array of four numbers
in the order `[minLongitude, minLatitude, maxLongitude, maxLatitude]`.
example:
- -30
- -40
- 40
- 30
items:
description: The longitudinal or latitudinal coordinates of the bounding
box.
format: double
type: number
maxItems: 4
minItems: 4
type: array
focus:
description: The 2-letter ISO code of a country to focus the map on. Or
`WORLD`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,48 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union

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


class GeomapWidgetDefinitionView(ModelNormal):
validations = {
"custom_extent": {
"max_items": 4,
"min_items": 4,
},
}

@cached_property
def openapi_types(_):
return {
"custom_extent": ([float],),
"focus": (str,),
}

attribute_map = {
"custom_extent": "custom_extent",
"focus": "focus",
}

def __init__(self_, focus: str, **kwargs):
def __init__(self_, focus: str, custom_extent: Union[List[float], UnsetType] = unset, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Code Quality Violation

Suggested change
def __init__(self_, focus: str, custom_extent: Union[List[float], UnsetType] = unset, **kwargs):
def __init__(self, focus: str, custom_extent: Union[List[float], UnsetType] = unset, **kwargs):
first parameter of a class function should be self (...read more)

In a class method (that is not a class method nor a static method), the first argument must be self by convention.

Learn More

View in Datadog  Leave us feedback  Documentation

"""
The view of the world that the map should render.

:param custom_extent: A custom extent of the map defined by an array of four numbers in the order ``[minLongitude, minLatitude, maxLongitude, maxLatitude]``.
:type custom_extent: [float], optional

:param focus: The 2-letter ISO code of a country to focus the map on. Or ``WORLD``.
:type focus: str
"""
if custom_extent is not unset:
kwargs["custom_extent"] = custom_extent
super().__init__(kwargs)

self_.focus = focus