From f3d234fb3711596840bda55796961ff6082912fa Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:17:10 -0400 Subject: [PATCH 1/7] chore: linting removing unused import --- src/msgraph_core/tasks/large_file_upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msgraph_core/tasks/large_file_upload.py b/src/msgraph_core/tasks/large_file_upload.py index a848caee..be71adaa 100644 --- a/src/msgraph_core/tasks/large_file_upload.py +++ b/src/msgraph_core/tasks/large_file_upload.py @@ -14,7 +14,7 @@ from kiota_abstractions.request_adapter import RequestAdapter -from msgraph_core.models import LargeFileUploadSession, UploadResult, UploadSessionDataHolder # check imports +from msgraph_core.models import LargeFileUploadSession, UploadResult # check imports class LargeFileUploadTask: From 857ad9950a0200dbe69d4b96052725624fbe8833 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:22:26 -0400 Subject: [PATCH 2/7] fix: fixes exception configuration in pylint --- .pylintrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 99ccac38..1b5b6580 100644 --- a/.pylintrc +++ b/.pylintrc @@ -513,5 +513,5 @@ preferred-modules= # Exceptions that will emit a warning when being caught. Defaults to # "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception \ No newline at end of file +overgeneral-exceptions=builtins.BaseException, + builtins.Exception \ No newline at end of file From d7c0e1b901ffb0970eb6b94dd623dda41995a772 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:24:51 -0400 Subject: [PATCH 3/7] fix: suppressed linting error message that fails dependencies --- src/msgraph_core/tasks/large_file_upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msgraph_core/tasks/large_file_upload.py b/src/msgraph_core/tasks/large_file_upload.py index be71adaa..9bd79ee3 100644 --- a/src/msgraph_core/tasks/large_file_upload.py +++ b/src/msgraph_core/tasks/large_file_upload.py @@ -20,7 +20,7 @@ class LargeFileUploadTask: def __init__( - self, + self, # pylint: disable=too-many-instance-attributes upload_session: Parsable, request_adapter: RequestAdapter, stream: BytesIO, @@ -128,7 +128,7 @@ async def upload(self, after_chunk_upload: Optional[Callable] = None): self.next_range = next_range[0] + "-" process_next = await self.next_chunk(self.stream) - except Exception as error: + except Exception as error: #pylint: disable=broad-except logging.error("Error uploading chunk %s", error) finally: self.chunks -= 1 From b56cc8d11221166fbd4c8002dfdf9eb027968b5e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:29:16 -0400 Subject: [PATCH 4/7] fix: linting fix import ordering --- src/msgraph_core/base_graph_request_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msgraph_core/base_graph_request_adapter.py b/src/msgraph_core/base_graph_request_adapter.py index 2ca00adc..51834b6f 100644 --- a/src/msgraph_core/base_graph_request_adapter.py +++ b/src/msgraph_core/base_graph_request_adapter.py @@ -1,3 +1,4 @@ +from typing import Optional import httpx from kiota_abstractions.authentication import AuthenticationProvider from kiota_abstractions.serialization import ( @@ -7,7 +8,6 @@ SerializationWriterFactoryRegistry, ) from kiota_http.httpx_request_adapter import HttpxRequestAdapter -from typing import Optional from .graph_client_factory import GraphClientFactory From 7ad013e52190ab607dfe82c86ae68c87e7abe4cc Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:30:41 -0400 Subject: [PATCH 5/7] fix: adds missing whitespace for suppressions Signed-off-by: Vincent Biret --- src/msgraph_core/tasks/large_file_upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msgraph_core/tasks/large_file_upload.py b/src/msgraph_core/tasks/large_file_upload.py index 9bd79ee3..89e8ba46 100644 --- a/src/msgraph_core/tasks/large_file_upload.py +++ b/src/msgraph_core/tasks/large_file_upload.py @@ -20,7 +20,7 @@ class LargeFileUploadTask: def __init__( - self, # pylint: disable=too-many-instance-attributes + self, # pylint: disable=too-many-instance-attributes upload_session: Parsable, request_adapter: RequestAdapter, stream: BytesIO, @@ -128,7 +128,7 @@ async def upload(self, after_chunk_upload: Optional[Callable] = None): self.next_range = next_range[0] + "-" process_next = await self.next_chunk(self.stream) - except Exception as error: #pylint: disable=broad-except + except Exception as error: #pylint: disable=broad-except logging.error("Error uploading chunk %s", error) finally: self.chunks -= 1 From b6c1d29777829aedf50cadf994e9b8ea68d8ed4a Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:37:43 -0400 Subject: [PATCH 6/7] fix: moves attributes suppression to class definition Signed-off-by: Vincent Biret --- src/msgraph_core/tasks/large_file_upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msgraph_core/tasks/large_file_upload.py b/src/msgraph_core/tasks/large_file_upload.py index 89e8ba46..d9d75456 100644 --- a/src/msgraph_core/tasks/large_file_upload.py +++ b/src/msgraph_core/tasks/large_file_upload.py @@ -16,11 +16,11 @@ from msgraph_core.models import LargeFileUploadSession, UploadResult # check imports - +# pylint: disable=too-many-instance-attributes class LargeFileUploadTask: def __init__( - self, # pylint: disable=too-many-instance-attributes + self, upload_session: Parsable, request_adapter: RequestAdapter, stream: BytesIO, From f39f0b9b68f94b91c6b179f5f65db960922ecc77 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 12 Jul 2024 09:41:43 -0400 Subject: [PATCH 7/7] fix: linting missing line Signed-off-by: Vincent Biret --- src/msgraph_core/tasks/large_file_upload.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/msgraph_core/tasks/large_file_upload.py b/src/msgraph_core/tasks/large_file_upload.py index d9d75456..dcb5c5c0 100644 --- a/src/msgraph_core/tasks/large_file_upload.py +++ b/src/msgraph_core/tasks/large_file_upload.py @@ -16,6 +16,7 @@ from msgraph_core.models import LargeFileUploadSession, UploadResult # check imports + # pylint: disable=too-many-instance-attributes class LargeFileUploadTask: