dagster-shared 1.11.8__tar.gz → 1.11.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.
- {dagster_shared-1.11.8/dagster_shared.egg-info → dagster_shared-1.11.10}/PKG-INFO +1 -1
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/error.py +6 -5
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/plus/config.py +58 -0
- dagster_shared-1.11.10/dagster_shared/plus/config_utils.py +186 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/objects/__init__.py +0 -4
- dagster_shared-1.11.10/dagster_shared/serdes/objects/models/__init__.py +4 -0
- dagster_shared-1.11.10/dagster_shared/serdes/objects/models/defs_state_info.py +41 -0
- dagster_shared-1.11.10/dagster_shared/version.py +1 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10/dagster_shared.egg-info}/PKG-INFO +1 -1
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared.egg-info/SOURCES.txt +3 -1
- dagster_shared-1.11.8/dagster_shared/serdes/objects/defs_state_info.py +0 -55
- dagster_shared-1.11.8/dagster_shared/version.py +0 -1
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/LICENSE +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/MANIFEST.in +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/README.md +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/check/README.md +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/check/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/check/builder.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/check/decorator.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/check/functions.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/check/record.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/cli/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/dagster_model/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/dagster_model/pydantic_compat_layer.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/ipc.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/libraries/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/match.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/merger.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/modules.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/plus/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/plus/login_server.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/py.typed +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/record/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/scaffold/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/errors.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/objects/definition_metadata.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/objects/package_entry.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/serdes.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/utils.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/seven/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/seven/abc.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/seven/compat/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/seven/json.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/seven/temp_dir.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/telemetry/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/cached_method.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/config.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/hash.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/test.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/timing.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/utils/warnings.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/yaml_utils/__init__.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/yaml_utils/sample_yaml.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/yaml_utils/source_position.py +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared.egg-info/dependency_links.txt +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared.egg-info/not-zip-safe +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared.egg-info/requires.txt +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared.egg-info/top_level.txt +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/setup.cfg +0 -0
- {dagster_shared-1.11.8 → dagster_shared-1.11.10}/setup.py +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# mypy does not support recursive types, so "cause" has to be typed `Any`
|
|
2
|
+
import os
|
|
2
3
|
import sys
|
|
3
4
|
import traceback
|
|
4
5
|
from collections.abc import Sequence
|
|
@@ -102,14 +103,14 @@ class SerializableErrorInfo(
|
|
|
102
103
|
|
|
103
104
|
|
|
104
105
|
DAGSTER_FRAMEWORK_SUBSTRINGS = [
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
106
|
+
os.sep + os.path.join("site-packages", "dagster"),
|
|
107
|
+
os.sep + os.path.join("python_modules", "dagster"),
|
|
108
|
+
os.sep + os.path.join("python_modules", "libraries", "dagster"),
|
|
108
109
|
]
|
|
109
110
|
|
|
110
111
|
IMPORT_MACHINERY_SUBSTRINGS = [
|
|
111
|
-
"importlib
|
|
112
|
-
"importlib
|
|
112
|
+
os.path.join("importlib", "__init__.py"),
|
|
113
|
+
os.path.join("importlib", "metadata", "__init__.py"),
|
|
113
114
|
"importlib._bootstrap",
|
|
114
115
|
]
|
|
115
116
|
|
|
@@ -67,6 +67,64 @@ class DagsterPlusCliConfig:
|
|
|
67
67
|
_, _, raw_plus_config, _ = result
|
|
68
68
|
return cls(**raw_plus_config)
|
|
69
69
|
|
|
70
|
+
@classmethod
|
|
71
|
+
def create_for_deployment(
|
|
72
|
+
cls,
|
|
73
|
+
deployment: Optional[str],
|
|
74
|
+
organization: Optional[str] = None,
|
|
75
|
+
user_token: Optional[str] = None,
|
|
76
|
+
) -> "DagsterPlusCliConfig":
|
|
77
|
+
"""Create a DagsterPlusCliConfig instance for deployment-scoped operations.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
deployment: The deployment name to target
|
|
81
|
+
organization: Organization name (if None, will try to load from existing config)
|
|
82
|
+
user_token: User token (if None, will try to load from existing config)
|
|
83
|
+
"""
|
|
84
|
+
# Try to get base config if it exists, but don't require it
|
|
85
|
+
base_config = {}
|
|
86
|
+
if cls.exists():
|
|
87
|
+
try:
|
|
88
|
+
base_config = cls.get().__dict__
|
|
89
|
+
except Exception:
|
|
90
|
+
# If config exists but is invalid, start with empty base
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
return cls(
|
|
94
|
+
url=base_config.get("url"),
|
|
95
|
+
organization=organization or base_config.get("organization"),
|
|
96
|
+
default_deployment=deployment, # Override with specific deployment
|
|
97
|
+
user_token=user_token or base_config.get("user_token"),
|
|
98
|
+
agent_timeout=base_config.get("agent_timeout"),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def create_for_organization(
|
|
103
|
+
cls, organization: Optional[str] = None, user_token: Optional[str] = None
|
|
104
|
+
) -> "DagsterPlusCliConfig":
|
|
105
|
+
"""Create a DagsterPlusCliConfig instance for organization-scoped operations.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
organization: Organization name (if None, will try to load from existing config)
|
|
109
|
+
user_token: User token (if None, will try to load from existing config)
|
|
110
|
+
"""
|
|
111
|
+
# Try to get base config if it exists, but don't require it
|
|
112
|
+
base_config = {}
|
|
113
|
+
if cls.exists():
|
|
114
|
+
try:
|
|
115
|
+
base_config = cls.get().__dict__
|
|
116
|
+
except Exception:
|
|
117
|
+
# If config exists but is invalid, start with empty base
|
|
118
|
+
pass
|
|
119
|
+
|
|
120
|
+
return cls(
|
|
121
|
+
url=base_config.get("url"),
|
|
122
|
+
organization=organization or base_config.get("organization"),
|
|
123
|
+
default_deployment=None, # No deployment for organization-scoped operations
|
|
124
|
+
user_token=user_token or base_config.get("user_token"),
|
|
125
|
+
agent_timeout=base_config.get("agent_timeout"),
|
|
126
|
+
)
|
|
127
|
+
|
|
70
128
|
def write(self):
|
|
71
129
|
existing_config = _get_dagster_plus_config_path_and_raw_config()
|
|
72
130
|
if existing_config is None:
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import os
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
|
|
7
|
+
from dagster_shared.plus.config import DagsterPlusCliConfig
|
|
8
|
+
|
|
9
|
+
# Constants for CLI arguments and environment variables
|
|
10
|
+
DEPLOYMENT_CLI_ARGUMENT = "deployment"
|
|
11
|
+
DEPLOYMENT_ENV_VAR_NAME = "DAGSTER_CLOUD_DEPLOYMENT"
|
|
12
|
+
|
|
13
|
+
ORGANIZATION_CLI_ARGUMENT = "organization"
|
|
14
|
+
ORGANIZATION_ENV_VAR_NAME = "DAGSTER_CLOUD_ORGANIZATION"
|
|
15
|
+
|
|
16
|
+
TOKEN_CLI_ARGUMENT = "api_token"
|
|
17
|
+
TOKEN_ENV_VAR_NAME = "DAGSTER_CLOUD_API_TOKEN"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_deployment(ctx: Optional[click.Context] = None) -> Optional[str]:
|
|
21
|
+
"""Gets the configured deployment to target.
|
|
22
|
+
Highest precedence is a deployment argument, then `DAGSTER_CLOUD_DEPLOYMENT` env var, then config file default.
|
|
23
|
+
"""
|
|
24
|
+
if ctx and ctx.params.get(DEPLOYMENT_CLI_ARGUMENT):
|
|
25
|
+
return ctx.params[DEPLOYMENT_CLI_ARGUMENT]
|
|
26
|
+
|
|
27
|
+
env_value = os.getenv(DEPLOYMENT_ENV_VAR_NAME)
|
|
28
|
+
if env_value:
|
|
29
|
+
return env_value
|
|
30
|
+
|
|
31
|
+
# Fall back to config file
|
|
32
|
+
if DagsterPlusCliConfig.exists():
|
|
33
|
+
try:
|
|
34
|
+
config = DagsterPlusCliConfig.get()
|
|
35
|
+
return config.default_deployment
|
|
36
|
+
except Exception:
|
|
37
|
+
pass
|
|
38
|
+
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_organization(ctx: Optional[click.Context] = None) -> Optional[str]:
|
|
43
|
+
"""Gets the configured organization to target.
|
|
44
|
+
Highest precedence is an organization argument, then `DAGSTER_CLOUD_ORGANIZATION` env var, then config file.
|
|
45
|
+
"""
|
|
46
|
+
if ctx and ctx.params.get(ORGANIZATION_CLI_ARGUMENT):
|
|
47
|
+
return ctx.params[ORGANIZATION_CLI_ARGUMENT]
|
|
48
|
+
|
|
49
|
+
env_value = os.getenv(ORGANIZATION_ENV_VAR_NAME)
|
|
50
|
+
if env_value:
|
|
51
|
+
return env_value
|
|
52
|
+
|
|
53
|
+
# Fall back to config file
|
|
54
|
+
if DagsterPlusCliConfig.exists():
|
|
55
|
+
try:
|
|
56
|
+
config = DagsterPlusCliConfig.get()
|
|
57
|
+
return config.organization
|
|
58
|
+
except Exception:
|
|
59
|
+
pass
|
|
60
|
+
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def get_user_token(ctx: Optional[click.Context] = None) -> Optional[str]:
|
|
65
|
+
"""Gets the configured user token to use.
|
|
66
|
+
Highest precedence is an api-token argument, then `DAGSTER_CLOUD_API_TOKEN` env var, then config file.
|
|
67
|
+
"""
|
|
68
|
+
if ctx and ctx.params.get(TOKEN_CLI_ARGUMENT):
|
|
69
|
+
return ctx.params[TOKEN_CLI_ARGUMENT]
|
|
70
|
+
|
|
71
|
+
env_value = os.getenv(TOKEN_ENV_VAR_NAME)
|
|
72
|
+
if env_value:
|
|
73
|
+
return env_value
|
|
74
|
+
|
|
75
|
+
# Fall back to config file
|
|
76
|
+
if DagsterPlusCliConfig.exists():
|
|
77
|
+
try:
|
|
78
|
+
config = DagsterPlusCliConfig.get()
|
|
79
|
+
return config.user_token
|
|
80
|
+
except Exception:
|
|
81
|
+
pass
|
|
82
|
+
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Click option definitions for reuse across commands
|
|
87
|
+
DEPLOYMENT_OPTION = click.option(
|
|
88
|
+
"--deployment",
|
|
89
|
+
"-d",
|
|
90
|
+
help="Deployment to target.",
|
|
91
|
+
envvar=DEPLOYMENT_ENV_VAR_NAME,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
ORGANIZATION_OPTION = click.option(
|
|
95
|
+
"--organization",
|
|
96
|
+
"-o",
|
|
97
|
+
help="Organization to target.",
|
|
98
|
+
envvar=ORGANIZATION_ENV_VAR_NAME,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
TOKEN_OPTION = click.option(
|
|
102
|
+
"--api-token",
|
|
103
|
+
help="Dagster Cloud API token.",
|
|
104
|
+
envvar=TOKEN_ENV_VAR_NAME,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
VIEW_GRAPHQL_OPTION = click.option(
|
|
108
|
+
"--view-graphql",
|
|
109
|
+
is_flag=True,
|
|
110
|
+
help="Print GraphQL queries and responses to stderr for debugging.",
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def dg_api_options(
|
|
115
|
+
deployment_scoped: bool = False,
|
|
116
|
+
organization_scoped: bool = False,
|
|
117
|
+
):
|
|
118
|
+
"""Apply this decorator to Click commands to add organization, deployment, and token options.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
deployment_scoped: If True, requires deployment to be specified and validates it
|
|
122
|
+
organization_scoped: If True, only requires organization (deployment is optional)
|
|
123
|
+
"""
|
|
124
|
+
if deployment_scoped and organization_scoped:
|
|
125
|
+
raise ValueError("Cannot specify both deployment_scoped and organization_scoped")
|
|
126
|
+
|
|
127
|
+
if not deployment_scoped and not organization_scoped:
|
|
128
|
+
raise ValueError("Must specify either deployment_scoped or organization_scoped")
|
|
129
|
+
|
|
130
|
+
def decorator(func):
|
|
131
|
+
# Add options in reverse order (Click applies them in reverse)
|
|
132
|
+
func = VIEW_GRAPHQL_OPTION(func)
|
|
133
|
+
func = TOKEN_OPTION(func)
|
|
134
|
+
func = ORGANIZATION_OPTION(func)
|
|
135
|
+
|
|
136
|
+
if deployment_scoped:
|
|
137
|
+
func = DEPLOYMENT_OPTION(func)
|
|
138
|
+
|
|
139
|
+
@functools.wraps(func)
|
|
140
|
+
def wrapper(*args, **kwargs):
|
|
141
|
+
ctx = click.get_current_context()
|
|
142
|
+
|
|
143
|
+
# Check if we're in test mode with DgApiTestContext
|
|
144
|
+
# Import here to avoid circular imports
|
|
145
|
+
from dagster_dg_cli.cli.api.client import DgApiTestContext
|
|
146
|
+
|
|
147
|
+
if ctx.obj and isinstance(ctx.obj, DgApiTestContext):
|
|
148
|
+
organization = ctx.obj.organization
|
|
149
|
+
deployment = ctx.obj.deployment if deployment_scoped else None
|
|
150
|
+
api_token = None
|
|
151
|
+
view_graphql = False # Default to False in test mode
|
|
152
|
+
else:
|
|
153
|
+
# Get resolved values using precedence chain
|
|
154
|
+
organization = get_organization(ctx)
|
|
155
|
+
deployment = get_deployment(ctx) if deployment_scoped else None
|
|
156
|
+
api_token = get_user_token(ctx)
|
|
157
|
+
view_graphql = kwargs.get("view_graphql", False)
|
|
158
|
+
|
|
159
|
+
if not organization:
|
|
160
|
+
raise click.UsageError(
|
|
161
|
+
"A Dagster Cloud organization must be specified.\n\n"
|
|
162
|
+
"You may specify an organization by:\n"
|
|
163
|
+
f"- Providing the --organization parameter\n"
|
|
164
|
+
f"- Setting the {ORGANIZATION_ENV_VAR_NAME} environment variable"
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
if deployment_scoped and not deployment:
|
|
168
|
+
raise click.UsageError(
|
|
169
|
+
"A Dagster Cloud deployment must be specified for this command.\n\n"
|
|
170
|
+
"You may specify a deployment by:\n"
|
|
171
|
+
f"- Providing the --deployment parameter\n"
|
|
172
|
+
f"- Setting the {DEPLOYMENT_ENV_VAR_NAME} environment variable"
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
# Update kwargs with resolved values
|
|
176
|
+
kwargs["organization"] = organization
|
|
177
|
+
kwargs["api_token"] = api_token
|
|
178
|
+
kwargs["view_graphql"] = view_graphql
|
|
179
|
+
if deployment_scoped:
|
|
180
|
+
kwargs["deployment"] = deployment
|
|
181
|
+
|
|
182
|
+
return func(*args, **kwargs)
|
|
183
|
+
|
|
184
|
+
return wrapper
|
|
185
|
+
|
|
186
|
+
return decorator
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
from dagster_shared.serdes.objects.defs_state_info import (
|
|
2
|
-
DefsKeyStateInfo as DefsKeyStateInfo,
|
|
3
|
-
DefsStateInfo as DefsStateInfo,
|
|
4
|
-
)
|
|
5
1
|
from dagster_shared.serdes.objects.package_entry import (
|
|
6
2
|
ComponentFeatureData as ComponentFeatureData,
|
|
7
3
|
EnvRegistryKey as EnvRegistryKey,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import time
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from dagster_shared.dagster_model import DagsterModel
|
|
6
|
+
from dagster_shared.serdes import whitelist_for_serdes
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@whitelist_for_serdes
|
|
10
|
+
class DefsKeyStateInfo(DagsterModel):
|
|
11
|
+
"""Records information about the version of the state for a given defs key."""
|
|
12
|
+
|
|
13
|
+
version: str
|
|
14
|
+
create_timestamp: float
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@whitelist_for_serdes
|
|
18
|
+
class DefsStateInfo(DagsterModel):
|
|
19
|
+
"""All of the information about the state version that will be used to load a given code location."""
|
|
20
|
+
|
|
21
|
+
info_mapping: Mapping[str, Optional[DefsKeyStateInfo]]
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def empty() -> "DefsStateInfo":
|
|
25
|
+
return DefsStateInfo(info_mapping={})
|
|
26
|
+
|
|
27
|
+
@staticmethod
|
|
28
|
+
def add_version(
|
|
29
|
+
current_info: Optional["DefsStateInfo"], key: str, version: Optional[str]
|
|
30
|
+
) -> "DefsStateInfo":
|
|
31
|
+
new_info = (
|
|
32
|
+
DefsKeyStateInfo(version=version, create_timestamp=time.time()) if version else None
|
|
33
|
+
)
|
|
34
|
+
if current_info is None:
|
|
35
|
+
return DefsStateInfo(info_mapping={key: new_info})
|
|
36
|
+
else:
|
|
37
|
+
return DefsStateInfo(info_mapping={**current_info.info_mapping, key: new_info})
|
|
38
|
+
|
|
39
|
+
def get_version(self, key: str) -> Optional[str]:
|
|
40
|
+
info = self.info_mapping.get(key)
|
|
41
|
+
return info.version if info else None
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.11.10"
|
|
@@ -29,6 +29,7 @@ dagster_shared/dagster_model/pydantic_compat_layer.py
|
|
|
29
29
|
dagster_shared/libraries/__init__.py
|
|
30
30
|
dagster_shared/plus/__init__.py
|
|
31
31
|
dagster_shared/plus/config.py
|
|
32
|
+
dagster_shared/plus/config_utils.py
|
|
32
33
|
dagster_shared/plus/login_server.py
|
|
33
34
|
dagster_shared/record/__init__.py
|
|
34
35
|
dagster_shared/scaffold/__init__.py
|
|
@@ -38,8 +39,9 @@ dagster_shared/serdes/serdes.py
|
|
|
38
39
|
dagster_shared/serdes/utils.py
|
|
39
40
|
dagster_shared/serdes/objects/__init__.py
|
|
40
41
|
dagster_shared/serdes/objects/definition_metadata.py
|
|
41
|
-
dagster_shared/serdes/objects/defs_state_info.py
|
|
42
42
|
dagster_shared/serdes/objects/package_entry.py
|
|
43
|
+
dagster_shared/serdes/objects/models/__init__.py
|
|
44
|
+
dagster_shared/serdes/objects/models/defs_state_info.py
|
|
43
45
|
dagster_shared/seven/__init__.py
|
|
44
46
|
dagster_shared/seven/abc.py
|
|
45
47
|
dagster_shared/seven/json.py
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
from collections.abc import Mapping
|
|
3
|
-
from typing import Any, Optional
|
|
4
|
-
|
|
5
|
-
from dagster_shared.record import record
|
|
6
|
-
from dagster_shared.serdes import whitelist_for_serdes
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@whitelist_for_serdes
|
|
10
|
-
@record
|
|
11
|
-
class DefsKeyStateInfo:
|
|
12
|
-
"""Records information about the version of the state for a given defs key."""
|
|
13
|
-
|
|
14
|
-
version: str
|
|
15
|
-
create_timestamp: float
|
|
16
|
-
|
|
17
|
-
@staticmethod
|
|
18
|
-
def from_dict(val: dict[str, Any]) -> "DefsKeyStateInfo":
|
|
19
|
-
return DefsKeyStateInfo(version=val["version"], create_timestamp=val["create_timestamp"])
|
|
20
|
-
|
|
21
|
-
def to_dict(self) -> dict[str, Any]:
|
|
22
|
-
return {"version": self.version, "create_timestamp": self.create_timestamp}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@whitelist_for_serdes
|
|
26
|
-
@record
|
|
27
|
-
class DefsStateInfo:
|
|
28
|
-
"""All of the information about the state version that will be used to load a given code location."""
|
|
29
|
-
|
|
30
|
-
info_mapping: Mapping[str, DefsKeyStateInfo]
|
|
31
|
-
|
|
32
|
-
@staticmethod
|
|
33
|
-
def add_version(
|
|
34
|
-
current_info: Optional["DefsStateInfo"], key: str, version: str
|
|
35
|
-
) -> "DefsStateInfo":
|
|
36
|
-
new_info = DefsKeyStateInfo(version=version, create_timestamp=time.time())
|
|
37
|
-
if current_info is None:
|
|
38
|
-
return DefsStateInfo(info_mapping={key: new_info})
|
|
39
|
-
else:
|
|
40
|
-
return DefsStateInfo(info_mapping={**current_info.info_mapping, key: new_info})
|
|
41
|
-
|
|
42
|
-
@staticmethod
|
|
43
|
-
def from_dict(val: dict[str, Any]) -> "DefsStateInfo":
|
|
44
|
-
"""Used for converting from the user-facing dict representation."""
|
|
45
|
-
return DefsStateInfo(
|
|
46
|
-
info_mapping={key: DefsKeyStateInfo.from_dict(info) for key, info in val.items()}
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
def to_dict(self) -> dict[str, Any]:
|
|
50
|
-
"""Used for converting to the user-facing dict representation."""
|
|
51
|
-
return {key: info.to_dict() for key, info in self.info_mapping.items()}
|
|
52
|
-
|
|
53
|
-
def get_version(self, key: str) -> Optional[str]:
|
|
54
|
-
info = self.info_mapping.get(key)
|
|
55
|
-
return info.version if info else None
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.11.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/serdes/objects/package_entry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared/yaml_utils/source_position.py
RENAMED
|
File without changes
|
{dagster_shared-1.11.8 → dagster_shared-1.11.10}/dagster_shared.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|