From d3a9df806bd961a4890e315c4c3ff301ceb456c2 Mon Sep 17 00:00:00 2001 From: chrishiste Date: Tue, 27 Feb 2024 17:06:12 -0300 Subject: [PATCH] fix: Ruff --- .../libraries/dagster-wandb/dagster_wandb/io_manager.py | 1 - .../libraries/dagster-wandb/dagster_wandb/launch/ops.py | 1 - .../libraries/dagster-wandb/dagster_wandb/resources.py | 3 +-- .../dagster-wandb/dagster_wandb_tests/launch/test_ops.py | 1 + .../dagster-wandb/dagster_wandb_tests/test_errors.py | 1 + .../dagster-wandb/dagster_wandb_tests/test_io_manager.py | 6 +++--- .../dagster-wandb/dagster_wandb_tests/test_pickling.py | 1 + .../dagster-wandb/dagster_wandb_tests/test_resources.py | 1 + python_modules/libraries/dagster-wandb/pyproject.toml | 2 ++ 9 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 python_modules/libraries/dagster-wandb/pyproject.toml diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb/io_manager.py b/python_modules/libraries/dagster-wandb/dagster_wandb/io_manager.py index 99bcf2af2cf36..231b11864f994 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb/io_manager.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb/io_manager.py @@ -21,7 +21,6 @@ io_manager, ) from dagster._core.storage.io_manager import dagster_maintained_io_manager - from wandb import Artifact from wandb.data_types import WBValue diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb/launch/ops.py b/python_modules/libraries/dagster-wandb/dagster_wandb/launch/ops.py index 70b2bb8ae26fe..f645aad8cd53a 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb/launch/ops.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb/launch/ops.py @@ -1,5 +1,4 @@ from dagster import OpExecutionContext, op - from wandb.sdk.launch import launch, launch_add from .configs import launch_agent_config, launch_config diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb/resources.py b/python_modules/libraries/dagster-wandb/dagster_wandb/resources.py index 21edc55ca5d50..ca73d5a3c2bcb 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb/resources.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb/resources.py @@ -1,9 +1,8 @@ from typing import Any, Dict +import wandb from dagster import Field, InitResourceContext, String, StringSource, resource from dagster._core.definitions.resource_definition import dagster_maintained_resource - -import wandb from wandb.sdk.internal.internal_api import Api WANDB_CLOUD_HOST: str = "https://api.wandb.ai" diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/launch/test_ops.py b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/launch/test_ops.py index 15e307a47bf8c..56ca2101f4186 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/launch/test_ops.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/launch/test_ops.py @@ -2,6 +2,7 @@ import pytest from dagster import build_op_context + from dagster_wandb import wandb_resource from dagster_wandb.launch.ops import raise_on_invalid_config, run_launch_agent, run_launch_job diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_errors.py b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_errors.py index 8c1544070a4a2..7fccd1a27e4e0 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_errors.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_errors.py @@ -1,4 +1,5 @@ import pytest + from dagster_wandb.utils.errors import ( WandbArtifactsIOManagerError, raise_on_empty_configuration, diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_io_manager.py b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_io_manager.py index b0dd0eadfdac2..ef3f601019b89 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_io_manager.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_io_manager.py @@ -2,6 +2,7 @@ from unittest.mock import ANY, MagicMock, patch import pytest +import wandb from callee import EndsWith, Regex from dagster import ( AssetKey, @@ -13,15 +14,14 @@ build_input_context, build_output_context, ) +from wandb import Artifact + from dagster_wandb import ( WandbArtifactsIOManagerError, wandb_artifacts_io_manager, wandb_resource, ) -import wandb -from wandb import Artifact - DAGSTER_RUN_ID = "unit-testing" DAGSTER_RUN_ID_SHORT = DAGSTER_RUN_ID[0:8] DAGSTER_HOME = "/path/to/dagster_home" diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_pickling.py b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_pickling.py index 870f2052ec28c..055d1f0e080fa 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_pickling.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_pickling.py @@ -2,6 +2,7 @@ import pytest from dagster import build_output_context + from dagster_wandb.utils.pickling import pickle_artifact_content diff --git a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_resources.py b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_resources.py index 4fffd2576acae..ed0b316eeaf02 100644 --- a/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_resources.py +++ b/python_modules/libraries/dagster-wandb/dagster_wandb_tests/test_resources.py @@ -1,6 +1,7 @@ from unittest.mock import patch from dagster import build_init_resource_context + from dagster_wandb.resources import WANDB_CLOUD_HOST, wandb_resource API_KEY = "api_key" diff --git a/python_modules/libraries/dagster-wandb/pyproject.toml b/python_modules/libraries/dagster-wandb/pyproject.toml new file mode 100644 index 0000000000000..4e15e65791a35 --- /dev/null +++ b/python_modules/libraries/dagster-wandb/pyproject.toml @@ -0,0 +1,2 @@ +[tool.ruff] +extend = "../../../pyproject.toml" \ No newline at end of file