From ac641dec89845da63e3dc5b7e164eb9ed451c1ea Mon Sep 17 00:00:00 2001 From: mihran113 Date: Tue, 17 Dec 2024 02:37:19 +0400 Subject: [PATCH] [fix] Resolve issues with PR checks --- .github/workflows/pull-request.yml | 2 +- aim/sdk/run.py | 5 +++-- aim/storage/artifacts/s3_storage.py | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 049b7db857..152071b5e6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -46,7 +46,7 @@ jobs: - name: setup python uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: '3.8' architecture: x64 - name: install deps diff --git a/aim/sdk/run.py b/aim/sdk/run.py index 19c88e597b..08b89b8c37 100644 --- a/aim/sdk/run.py +++ b/aim/sdk/run.py @@ -418,10 +418,11 @@ def track( # artifacts logging API @property - def artifacts_uri(self) -> str: + def artifacts_uri(self) -> Optional[str]: if self._run_artifacts_uri is None: base_uri = self.meta_run_tree.get('artifacts_uri', None) - if base_uri is None: return None + if base_uri is None: + return None self._run_artifacts_uri = os.path.join(base_uri, self.hash) return self._run_artifacts_uri diff --git a/aim/storage/artifacts/s3_storage.py b/aim/storage/artifacts/s3_storage.py index 7369b26dfe..bc24c7372d 100644 --- a/aim/storage/artifacts/s3_storage.py +++ b/aim/storage/artifacts/s3_storage.py @@ -76,15 +76,19 @@ def _get_s3_client(self): def S3ArtifactStorage_factory(**boto3_client_kwargs: dict): class S3ArtifactStorageCustom(S3ArtifactStorage): def _get_s3_client(self): - import boto3, botocore + import boto3 + import botocore + if 'config' in boto3_client_kwargs and isinstance(boto3_client_kwargs['config'], dict): config_kwargs = boto3_client_kwargs.pop('config') boto3_client_kwargs['config'] = botocore.config.Config(**config_kwargs) client = boto3.client('s3', **boto3_client_kwargs) return client + return S3ArtifactStorageCustom def S3ArtifactStorage_clientconfig(**boto3_client_kwargs: dict): from aim.storage.artifacts import registry + registry.registry['s3'] = S3ArtifactStorage_factory(**boto3_client_kwargs)