From 467e5707bb8c8d55f4749fb887abfea3dc6396e9 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 22 Feb 2022 13:27:35 -0800 Subject: [PATCH 1/3] Improve except --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 2 +- sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index 13c41e50b408..5437149dd934 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.0.2 (Unreleased) -- This version and all future versions will require Python 3.7+. Python 2.7 and 3.6 are no longer supported. +- This version and all future versions will require Python 3.6+. Python 2.7 and 3.6 are no longer supported. ### Bugs Fixed diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py index 2739c697b0d6..b125f24ea69e 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py @@ -118,7 +118,7 @@ def native_col_type(col_type, value): if col_type == "datetime": try: value = Deserializer.deserialize_iso(value) - except: # pylint: disable=bare-except + except Exception: # pylint: disable=bare-except # if there is any exception in deserializing the iso, # return the value to the user pass From 19bab31ebed40462fb749f7f24fdf31f24362a84 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 22 Feb 2022 13:29:44 -0800 Subject: [PATCH 2/3] Update sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py --- sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py index b125f24ea69e..e86cfb0f2c1f 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py @@ -118,7 +118,7 @@ def native_col_type(col_type, value): if col_type == "datetime": try: value = Deserializer.deserialize_iso(value) - except Exception: # pylint: disable=bare-except + except Exception: # if there is any exception in deserializing the iso, # return the value to the user pass From ea7acf76ac77ac9675c96fe072b023aee01240e2 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 22 Feb 2022 13:32:16 -0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Laurent Mazuel --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 2 +- sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index 5437149dd934..3446ff158ab6 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.0.2 (Unreleased) -- This version and all future versions will require Python 3.6+. Python 2.7 and 3.6 are no longer supported. +- This version and all future versions will require Python 3.6+. Python 2.7 is no longer supported. ### Bugs Fixed diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py index e86cfb0f2c1f..63e98697290b 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py @@ -118,7 +118,7 @@ def native_col_type(col_type, value): if col_type == "datetime": try: value = Deserializer.deserialize_iso(value) - except Exception: + except Exception: # pylint: disable=broad-except # if there is any exception in deserializing the iso, # return the value to the user pass