dagster-wandb 0.21.5__tar.gz → 0.25.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dagster-wandb might be problematic. Click here for more details.

Files changed (26) hide show
  1. {dagster-wandb-0.21.5/dagster_wandb.egg-info → dagster-wandb-0.25.10}/PKG-INFO +2 -2
  2. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/README.md +1 -1
  3. dagster-wandb-0.25.10/dagster_wandb/__init__.py +19 -0
  4. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/io_manager.py +16 -20
  5. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/launch/configs.py +1 -1
  6. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/launch/ops.py +2 -3
  7. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/resources.py +2 -2
  8. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/types.py +7 -14
  9. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/utils/pickling.py +10 -10
  10. dagster-wandb-0.25.10/dagster_wandb/version.py +1 -0
  11. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10/dagster_wandb.egg-info}/PKG-INFO +2 -2
  12. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb.egg-info/requires.txt +2 -2
  13. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/setup.py +5 -5
  14. dagster-wandb-0.21.5/dagster_wandb/__init__.py +0 -19
  15. dagster-wandb-0.21.5/dagster_wandb/version.py +0 -1
  16. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/LICENSE +0 -0
  17. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/MANIFEST.in +0 -0
  18. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/launch/__init__.py +0 -0
  19. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/py.typed +0 -0
  20. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/utils/__init__.py +0 -0
  21. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb/utils/errors.py +0 -0
  22. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb.egg-info/SOURCES.txt +0 -0
  23. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb.egg-info/dependency_links.txt +0 -0
  24. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb.egg-info/not-zip-safe +0 -0
  25. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/dagster_wandb.egg-info/top_level.txt +0 -0
  26. {dagster-wandb-0.21.5 → dagster-wandb-0.25.10}/setup.cfg +0 -0
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dagster-wandb
3
- Version: 0.21.5
3
+ Version: 0.25.10
4
4
  Summary: Package for wandb Dagster components.
5
5
  Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-wandb
6
6
  Author: Dagster Labs
7
7
  Author-email: hello@dagsterlabs.com
8
8
  License: Apache-2.0
9
- Classifier: Programming Language :: Python :: 3.8
10
9
  Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: License :: OSI Approved :: Apache Software License
14
13
  Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.9,<3.13
15
15
  Provides-Extra: dev
16
16
  License-File: LICENSE
@@ -1,3 +1,3 @@
1
1
  # dagster-wandb
2
2
 
3
- For a complete set of documentation, see [Dagster integration](https://docs.wandb.ai/guides/integrations/dagster) on the W&B website.
3
+ For a complete set of documentation, see [Dagster integration](https://docs.wandb.ai/guides/integrations/dagster) on the W&B website.
@@ -0,0 +1,19 @@
1
+ from dagster._core.libraries import DagsterLibraryRegistry
2
+
3
+ from dagster_wandb.io_manager import WandbArtifactsIOManagerError, wandb_artifacts_io_manager
4
+ from dagster_wandb.launch.ops import run_launch_agent, run_launch_job
5
+ from dagster_wandb.resources import wandb_resource
6
+ from dagster_wandb.types import SerializationModule, WandbArtifactConfiguration
7
+ from dagster_wandb.version import __version__
8
+
9
+ DagsterLibraryRegistry.register("dagster-wandb", __version__)
10
+
11
+ __all__ = [
12
+ "SerializationModule",
13
+ "WandbArtifactConfiguration",
14
+ "WandbArtifactsIOManagerError",
15
+ "run_launch_agent",
16
+ "run_launch_job",
17
+ "wandb_artifacts_io_manager",
18
+ "wandb_resource",
19
+ ]
@@ -3,11 +3,10 @@ import os
3
3
  import pickle
4
4
  import platform
5
5
  import shutil
6
- import sys
7
6
  import time
8
7
  import uuid
9
8
  from contextlib import contextmanager
10
- from typing import List, Optional
9
+ from typing import Optional, TypedDict
11
10
 
12
11
  from dagster import (
13
12
  Field,
@@ -24,25 +23,22 @@ from dagster._core.storage.io_manager import dagster_maintained_io_manager
24
23
  from wandb import Artifact
25
24
  from wandb.data_types import WBValue
26
25
 
27
- from .resources import WANDB_CLOUD_HOST
28
- from .utils.errors import (
26
+ from dagster_wandb.resources import WANDB_CLOUD_HOST
27
+ from dagster_wandb.utils.errors import (
29
28
  WandbArtifactsIOManagerError,
30
29
  raise_on_empty_configuration,
31
30
  raise_on_unknown_partition_keys,
32
31
  raise_on_unknown_read_configuration_keys,
33
32
  raise_on_unknown_write_configuration_keys,
34
33
  )
35
- from .utils.pickling import (
34
+ from dagster_wandb.utils.pickling import (
36
35
  ACCEPTED_SERIALIZATION_MODULES,
37
36
  pickle_artifact_content,
38
37
  unpickle_artifact_content,
39
38
  )
40
- from .version import __version__
39
+ from dagster_wandb.version import __version__
41
40
 
42
- if sys.version_info >= (3, 8):
43
- from typing import TypedDict
44
- else:
45
- from typing_extensions import TypedDict
41
+ UNIT_TEST_RUN_ID = "0ab2e48b-6d63-4ff5-b160-662cc60145f4"
46
42
 
47
43
 
48
44
  class Config(TypedDict):
@@ -52,7 +48,7 @@ class Config(TypedDict):
52
48
  wandb_project: str
53
49
  wandb_run_name: Optional[str]
54
50
  wandb_run_id: Optional[str]
55
- wandb_run_tags: Optional[List[str]]
51
+ wandb_run_tags: Optional[list[str]]
56
52
  base_dir: str
57
53
  cache_duration_in_minutes: Optional[int]
58
54
 
@@ -161,8 +157,8 @@ class ArtifactsIOManager(IOManager):
161
157
 
162
158
  with self.wandb_run() as run:
163
159
  parameters = {}
164
- if context.metadata is not None:
165
- parameters = context.metadata.get("wandb_artifact_configuration", {})
160
+ if context.definition_metadata is not None:
161
+ parameters = context.definition_metadata.get("wandb_artifact_configuration", {})
166
162
 
167
163
  raise_on_unknown_write_configuration_keys(parameters)
168
164
 
@@ -293,7 +289,7 @@ class ArtifactsIOManager(IOManager):
293
289
  context.log.warning(
294
290
  "You've included a 'serialization_module' in the"
295
291
  " 'wandb_artifact_configuration' settings. However, this doesn't have"
296
- " any impact when the output is already an W&B object like e.g Table or"
292
+ " any impact when the output is already a W&B object like e.g Table or"
297
293
  " Image."
298
294
  )
299
295
  # Adds the WBValue object using the class name as the name for the file
@@ -364,8 +360,8 @@ class ArtifactsIOManager(IOManager):
364
360
  def _download_artifact(self, context: InputContext):
365
361
  with self.wandb_run() as run:
366
362
  parameters = {}
367
- if context.metadata is not None:
368
- parameters = context.metadata.get("wandb_artifact_configuration", {})
363
+ if context.definition_metadata is not None:
364
+ parameters = context.definition_metadata.get("wandb_artifact_configuration", {})
369
365
 
370
366
  raise_on_unknown_read_configuration_keys(parameters)
371
367
 
@@ -393,7 +389,7 @@ class ArtifactsIOManager(IOManager):
393
389
 
394
390
  artifact_name = parameters.get("name")
395
391
  if artifact_name is None:
396
- artifact_name = context.asset_key[0][0] # name of asset
392
+ artifact_name = context.asset_key.path[0] # name of asset
397
393
 
398
394
  partitions = [
399
395
  (key, f"{artifact_name}.{ str(key).replace('|', '-')}")
@@ -468,7 +464,7 @@ class ArtifactsIOManager(IOManager):
468
464
  output[key] = download_path
469
465
  continue
470
466
 
471
- artifact_dir = artifact.download(root=artifacts_path, recursive=True)
467
+ artifact_dir = artifact.download(root=artifacts_path)
472
468
  unpickled_content = unpickle_artifact_content(artifact_dir)
473
469
  if unpickled_content is not None:
474
470
  output[key] = unpickled_content
@@ -545,7 +541,7 @@ class ArtifactsIOManager(IOManager):
545
541
  path = artifact.get_path(path)
546
542
  return path.download(root=artifacts_path)
547
543
 
548
- artifact_dir = artifact.download(root=artifacts_path, recursive=True)
544
+ artifact_dir = artifact.download(root=artifacts_path)
549
545
 
550
546
  unpickled_content = unpickle_artifact_content(artifact_dir)
551
547
  if unpickled_content is not None:
@@ -711,7 +707,7 @@ def wandb_artifacts_io_manager(context: InitResourceContext):
711
707
  cache_duration_in_minutes = context.resource_config.get("cache_duration_in_minutes")
712
708
 
713
709
  if "PYTEST_CURRENT_TEST" in os.environ:
714
- dagster_run_id = "unit-testing"
710
+ dagster_run_id = UNIT_TEST_RUN_ID
715
711
  else:
716
712
  dagster_run_id = context.run_id
717
713
 
@@ -41,7 +41,7 @@ def launch_config():
41
41
  is_required=False,
42
42
  description=(
43
43
  "A dictionary containing parameters for the entry point command. Defaults to using"
44
- " the the parameters used to run the original run."
44
+ " the parameters used to run the original run."
45
45
  ),
46
46
  ),
47
47
  "name": Field(
@@ -1,8 +1,7 @@
1
1
  from dagster import OpExecutionContext, op
2
- from wandb.sdk.launch import launch
3
- from wandb.sdk.launch.launch_add import launch_add
2
+ from wandb.sdk.launch import launch, launch_add
4
3
 
5
- from .configs import launch_agent_config, launch_config
4
+ from dagster_wandb.launch.configs import launch_agent_config, launch_config
6
5
 
7
6
 
8
7
  def raise_on_invalid_config(context: OpExecutionContext):
@@ -1,4 +1,4 @@
1
- from typing import Any, Dict
1
+ from typing import Any
2
2
 
3
3
  import wandb
4
4
  from dagster import Field, InitResourceContext, String, StringSource, resource
@@ -27,7 +27,7 @@ WANDB_CLOUD_HOST: str = "https://api.wandb.ai"
27
27
  },
28
28
  description="Resource for interacting with Weights & Biases",
29
29
  )
30
- def wandb_resource(context: InitResourceContext) -> Dict[str, Any]:
30
+ def wandb_resource(context: InitResourceContext) -> dict[str, Any]:
31
31
  """Dagster resource used to communicate with the W&B API. It's useful when you want to use the
32
32
  wandb client within your ops and assets. It's a required resources if you are using the W&B IO
33
33
  Manager.
@@ -1,18 +1,11 @@
1
- import sys
2
-
3
- if sys.version_info >= (3, 8):
4
- from typing import TypedDict
5
- else:
6
- from typing_extensions import TypedDict
7
-
8
- from typing import Any, Dict, List
1
+ from typing import Any, TypedDict
9
2
 
10
3
 
11
4
  class SerializationModule(TypedDict, total=False):
12
5
  """W&B Artifacts IO Manager configuration of the serialization module. Useful for type checking."""
13
6
 
14
7
  name: str
15
- parameters: Dict[str, Any]
8
+ parameters: dict[str, Any]
16
9
 
17
10
 
18
11
  class WandbArtifactConfiguration(TypedDict, total=False):
@@ -21,9 +14,9 @@ class WandbArtifactConfiguration(TypedDict, total=False):
21
14
  name: str
22
15
  type: str
23
16
  description: str
24
- aliases: List[str]
25
- add_dirs: List[Dict[str, Any]]
26
- add_files: List[Dict[str, Any]]
27
- add_references: List[Dict[str, Any]]
17
+ aliases: list[str]
18
+ add_dirs: list[dict[str, Any]]
19
+ add_files: list[dict[str, Any]]
20
+ add_references: list[dict[str, Any]]
28
21
  serialization_module: SerializationModule
29
- partitions: Dict[str, Dict[str, Any]]
22
+ partitions: dict[str, dict[str, Any]]
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import pickle
3
3
 
4
- from .errors import WandbArtifactsIOManagerError
4
+ from dagster_wandb.utils.errors import WandbArtifactsIOManagerError
5
5
 
6
6
  PICKLE_FILENAME = "output.pickle"
7
7
  DILL_FILENAME = "output.dill"
@@ -55,7 +55,7 @@ def pickle_artifact_content(
55
55
  **artifact.metadata,
56
56
  **{
57
57
  "source_serialization_module": "dill",
58
- "source_dill_version_used": dill.__version__,
58
+ "source_dill_version_used": dill.__version__, # pyright: ignore[reportOptionalMemberAccess]
59
59
  "source_pickle_protocol_used": serialization_module_parameters_with_protocol[
60
60
  "protocol"
61
61
  ],
@@ -63,7 +63,7 @@ def pickle_artifact_content(
63
63
  }
64
64
  with artifact.new_file(DILL_FILENAME, "wb") as file:
65
65
  try:
66
- dill.dump(
66
+ dill.dump( # pyright: ignore[reportOptionalMemberAccess]
67
67
  obj,
68
68
  file,
69
69
  **serialization_module_parameters_with_protocol,
@@ -88,7 +88,7 @@ def pickle_artifact_content(
88
88
  **artifact.metadata,
89
89
  **{
90
90
  "source_serialization_module": "cloudpickle",
91
- "source_cloudpickle_version_used": cloudpickle.__version__,
91
+ "source_cloudpickle_version_used": cloudpickle.__version__, # pyright: ignore[reportOptionalMemberAccess]
92
92
  "source_pickle_protocol_used": serialization_module_parameters_with_protocol[
93
93
  "protocol"
94
94
  ],
@@ -96,7 +96,7 @@ def pickle_artifact_content(
96
96
  }
97
97
  with artifact.new_file(CLOUDPICKLE_FILENAME, "wb") as file:
98
98
  try:
99
- cloudpickle.dump(
99
+ cloudpickle.dump( # pyright: ignore[reportOptionalMemberAccess]
100
100
  obj,
101
101
  file,
102
102
  **serialization_module_parameters_with_protocol,
@@ -120,7 +120,7 @@ def pickle_artifact_content(
120
120
  **artifact.metadata,
121
121
  **{
122
122
  "source_serialization_module": "joblib",
123
- "source_joblib_version_used": joblib.__version__,
123
+ "source_joblib_version_used": joblib.__version__, # pyright: ignore[reportOptionalMemberAccess]
124
124
  "source_pickle_protocol_used": serialization_module_parameters_with_protocol[
125
125
  "protocol"
126
126
  ],
@@ -128,7 +128,7 @@ def pickle_artifact_content(
128
128
  }
129
129
  with artifact.new_file(JOBLIB_FILENAME, "wb") as file:
130
130
  try:
131
- joblib.dump(
131
+ joblib.dump( # pyright: ignore[reportOptionalMemberAccess]
132
132
  obj,
133
133
  file,
134
134
  **serialization_module_parameters_with_protocol,
@@ -182,7 +182,7 @@ def unpickle_artifact_content(artifact_dir):
182
182
  " was not found. Please, make sure it's installed."
183
183
  )
184
184
  with open(f"{artifact_dir}/{DILL_FILENAME}", "rb") as file:
185
- input_value = dill.load(file)
185
+ input_value = dill.load(file) # pyright: ignore[reportOptionalMemberAccess]
186
186
  return input_value
187
187
  elif os.path.exists(f"{artifact_dir}/{CLOUDPICKLE_FILENAME}"):
188
188
  if not has_cloudpickle:
@@ -191,7 +191,7 @@ def unpickle_artifact_content(artifact_dir):
191
191
  " module was not found. Please, make sure it's installed."
192
192
  )
193
193
  with open(f"{artifact_dir}/{CLOUDPICKLE_FILENAME}", "rb") as file:
194
- input_value = cloudpickle.load(file)
194
+ input_value = cloudpickle.load(file) # pyright: ignore[reportOptionalMemberAccess]
195
195
  return input_value
196
196
  elif os.path.exists(f"{artifact_dir}/{JOBLIB_FILENAME}"):
197
197
  if not has_joblib:
@@ -200,7 +200,7 @@ def unpickle_artifact_content(artifact_dir):
200
200
  " was not found. Please, make sure it's installed."
201
201
  )
202
202
  with open(f"{artifact_dir}/{JOBLIB_FILENAME}", "rb") as file:
203
- input_value = joblib.load(file)
203
+ input_value = joblib.load(file) # pyright: ignore[reportOptionalMemberAccess]
204
204
  return input_value
205
205
  elif os.path.exists(f"{artifact_dir}/{PICKLE_FILENAME}"):
206
206
  with open(f"{artifact_dir}/{PICKLE_FILENAME}", "rb") as file:
@@ -0,0 +1 @@
1
+ __version__ = "0.25.10"
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dagster-wandb
3
- Version: 0.21.5
3
+ Version: 0.25.10
4
4
  Summary: Package for wandb Dagster components.
5
5
  Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-wandb
6
6
  Author: Dagster Labs
7
7
  Author-email: hello@dagsterlabs.com
8
8
  License: Apache-2.0
9
- Classifier: Programming Language :: Python :: 3.8
10
9
  Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: License :: OSI Approved :: Apache Software License
14
13
  Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.9,<3.13
15
15
  Provides-Extra: dev
16
16
  License-File: LICENSE
@@ -1,5 +1,5 @@
1
- dagster==1.5.5
2
- wandb<0.15.5,>=0.13.5
1
+ dagster==1.9.10
2
+ wandb<1.0,>=0.15.11
3
3
 
4
4
  [dev]
5
5
  cloudpickle
@@ -1,11 +1,10 @@
1
1
  from pathlib import Path
2
- from typing import Dict
3
2
 
4
3
  from setuptools import find_packages, setup
5
4
 
6
5
 
7
6
  def get_version() -> str:
8
- version: Dict[str, str] = {}
7
+ version: dict[str, str] = {}
9
8
  with open(Path(__file__).parent / "dagster_wandb/version.py", encoding="utf8") as fp:
10
9
  exec(fp.read(), version)
11
10
 
@@ -24,7 +23,6 @@ setup(
24
23
  description="Package for wandb Dagster components.",
25
24
  url="https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-wandb",
26
25
  classifiers=[
27
- "Programming Language :: Python :: 3.8",
28
26
  "Programming Language :: Python :: 3.9",
29
27
  "Programming Language :: Python :: 3.10",
30
28
  "Programming Language :: Python :: 3.11",
@@ -32,9 +30,11 @@ setup(
32
30
  "Operating System :: OS Independent",
33
31
  ],
34
32
  packages=find_packages(exclude=["dagster_wandb_tests*"]),
33
+ include_package_data=True,
34
+ python_requires=">=3.9,<3.13",
35
35
  install_requires=[
36
- "dagster==1.5.5",
37
- "wandb>=0.13.5,<0.15.5",
36
+ "dagster==1.9.10",
37
+ "wandb>=0.15.11,<1.0",
38
38
  ],
39
39
  extras_require={"dev": ["cloudpickle", "joblib", "callee", "dill"]},
40
40
  zip_safe=False,
@@ -1,19 +0,0 @@
1
- from dagster._core.libraries import DagsterLibraryRegistry
2
-
3
- from .io_manager import WandbArtifactsIOManagerError, wandb_artifacts_io_manager
4
- from .launch.ops import run_launch_agent, run_launch_job
5
- from .resources import wandb_resource
6
- from .types import SerializationModule, WandbArtifactConfiguration
7
- from .version import __version__
8
-
9
- DagsterLibraryRegistry.register("dagster-wandb", __version__)
10
-
11
- __all__ = [
12
- "WandbArtifactsIOManagerError",
13
- "SerializationModule",
14
- "wandb_resource",
15
- "wandb_artifacts_io_manager",
16
- "WandbArtifactConfiguration",
17
- "run_launch_agent",
18
- "run_launch_job",
19
- ]
@@ -1 +0,0 @@
1
- __version__ = "0.21.5"
File without changes