Skip to content

Commit 0da2abc

Browse files
authored
[Monitor][Query] Fix docstring formatting (Azure#28324)
The description for the filter keyword argument is rendered and formatted strangely on the docs sites. This updates the string to match what is in the swagger, and the formatting is corrected. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
1 parent b7dd15c commit 0da2abc

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,18 @@ def query_resource(self, resource_uri: str, metric_names: List[str], **kwargs: A
8080
Only one order can be specified.
8181
Examples: sum asc.
8282
:paramtype order_by: str
83-
:keyword filter: The **$filter** is used to reduce the set of metric data
84-
returned.:code:`<br>`Example::code:`<br>`Metric contains metadata A, B and C.:code:`<br>`-
85-
Return all time series of C where A = a1 and B = b1 or b2:code:`<br>`\ **$filter=A eq ‘a1’ and
86-
B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`<br>`- Invalid variant::code:`<br>`\ **$filter=A
87-
eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`<br>`This is invalid because the
88-
logical or operator cannot separate two different metadata names.:code:`<br>`- Return all time
89-
series where A = a1, B = b1 and C = c1::code:`<br>`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq
90-
‘c1’**\ :code:`<br>`- Return all time series where A = a1:code:`<br>`\ **$filter=A eq ‘a1’ and
91-
B eq ‘\ *’ and C eq ‘*\ ’**.
92-
To use the split feature, set the value to * - for example, like "City eq '*'"
83+
:keyword filter: The **$filter** is used to reduce the set of metric data returned. Example:
84+
Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or
85+
b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A
86+
eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or
87+
operator cannot separate two different metadata names. - Return all time series where A = a1, B
88+
= b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series
89+
where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension
90+
name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1**
91+
Instead of using **$filter= "dim (test) 1 eq '*'"** use **$filter= "dim %2528test%2529 1 eq '*'"**.
92+
When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val**, instead of using
93+
**$filter= "dim (test) 3 eq 'dim3 (test) val'"** use **$filter= "dim
94+
%2528test%2529 3 eq 'dim3 %2528test%2529 val'"**. Default value is None.
9395
:paramtype filter: str
9496
:keyword metric_namespace: Metric namespace to query metric definitions for.
9597
:paramtype metric_namespace: str

sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,18 @@ async def query_resource(
7575
Only one order can be specified.
7676
Examples: sum asc.
7777
:paramtype order_by: str
78-
:keyword filter: The **$filter** is used to reduce the set of metric data
79-
returned.:code:`<br>`Example::code:`<br>`Metric contains metadata A, B and C.:code:`<br>`-
80-
Return all time series of C where A = a1 and B = b1 or b2:code:`<br>`\ **$filter=A eq ‘a1’ and
81-
B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`<br>`- Invalid variant::code:`<br>`\ **$filter=A
82-
eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`<br>`This is invalid because the
83-
logical or operator cannot separate two different metadata names.:code:`<br>`- Return all time
84-
series where A = a1, B = b1 and C = c1::code:`<br>`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq
85-
‘c1’**\ :code:`<br>`- Return all time series where A = a1:code:`<br>`\ **$filter=A eq ‘a1’ and
86-
B eq ‘\ *’ and C eq ‘*\ ’**.
87-
To use the split feature, set the value to * - for example, like "City eq '*'"
78+
:keyword filter: The **$filter** is used to reduce the set of metric data returned. Example:
79+
Metric contains metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or
80+
b2 **$filter=A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A
81+
eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** This is invalid because the logical or
82+
operator cannot separate two different metadata names. - Return all time series where A = a1, B
83+
= b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time series
84+
where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension
85+
name or dimension value uses round brackets. Eg: When dimension name is **dim (test) 1**
86+
Instead of using **$filter= "dim (test) 1 eq '*'"** use **$filter= "dim %2528test%2529 1 eq '*'"**.
87+
When dimension name is **dim (test) 3** and dimension value is **dim3 (test) val**, instead of using
88+
**$filter= "dim (test) 3 eq 'dim3 (test) val'"** use **$filter= "dim
89+
%2528test%2529 3 eq 'dim3 %2528test%2529 val'"**. Default value is None.
8890
:paramtype filter: str
8991
:keyword metric_namespace: Metric namespace to query metric definitions for.
9092
:paramtype metric_namespace: str

0 commit comments

Comments
 (0)