-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Section link:


Reason2,3:
ImportError: cannot import name 'LogsQueryRequest' from 'azure.monitor.query'
Reason4:
TypeError: query() missing 1 required keyword-only argument: 'timespan'
Reason5:
AttributeError: 'LogsBatchQueryResult' object has no attribute 'body'
Reason8:
The type of 'col' is 'str'. AttributeError: 'str' object has no attribute 'name'
Suggestion1:
Update to from datetime import timedelta, datetime
Suggestion2,3:
Update to LogsBatchQuery
Suggestion4:
Add the code timespan=(datetime(2021, 6, 2), timedelta(hours=1)),
Suggestion5:
tables = rsp.tables
if not tables:
print("Something is wrong")
else:
for table in tables:
Suggestion6:
Update to table.columns
Section link:

Reason1,2:
TypeError: query() missing 1 required keyword-only argument: 'timespan'
Suggestion1: Add the code: from datetime import datetime
Suggestion2: Add the code: timespan=(datetime(2021, 5, 2), datetime(2021, 6, 2))
Section link:

Reason:
NameError: name 'datetime' is not defined
Suggestion:
Update to from datetime import timedelta, datetime
Section link1, link2, link3, link4,link5:

Reason:
The type of 'col' is 'str'. AttributeError: 'str' object has no attribute 'name'
Suggestion:
Update to table.columns
Reason:
The type of 'col' is 'str'. AttributeError: 'str' object has no attribute 'name'
Suggestion:
for col, type in zip(table.columns, table.columns_types): #LogsQueryResultColumn
print(col + "/"+ type + " | ", end="")
Reason:
TypeError: query() missing 1 required keyword-only argument: 'timespan'
Suggestion:
Add the parameter timespan=(datetime(2021, 5, 2), datetime(2021, 6, 2)) in client.querty() .
Section link:

Reason:
AttributeError: 'MetricAvailability' object has no attribute 'time_grain'.
Suggestion:
Update to print(availability.granularity)
@jameszliao-msft , @lmazuel , @scottaddie , @srnagar and @rakshith91 for notification.

