Skip to content

Commit

Permalink
Don't restrict values for env_vars to str.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 658186331
Change-Id: I85504c2e561729687ab985887815fb72c5c9d608
GitOrigin-RevId: f07d2926d4856cfe69bd6e5d3f58d147920a74e0
  • Loading branch information
DeepMind Team authored and alpiccioni committed Dec 4, 2024
1 parent cd3fde5 commit 48f2c35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions xmanager/xm/job_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ async def launch(


def _validate_env_vars(
self: Any, attribute: Any, env_vars: Dict[str, str]
self: Any, attribute: Any, env_vars: Dict[str, Any]
) -> None:
del self # Unused.
del attribute # Unused.
Expand All @@ -362,7 +362,7 @@ class Packageable:
args: SequentialArgs = attr.ib(
factory=list, converter=SequentialArgs.from_collection
) # pytype: disable=annotation-type-mismatch
env_vars: Dict[str, str] = attr.ib(
env_vars: Dict[str, Any] = attr.ib(
converter=dict, default=attr.Factory(dict), validator=_validate_env_vars
)

Expand Down Expand Up @@ -409,7 +409,7 @@ class Job:
args: SequentialArgs = attr.ib(
factory=list, converter=SequentialArgs.from_collection
) # pytype: disable=annotation-type-mismatch
env_vars: Dict[str, str] = attr.ib(
env_vars: Dict[str, Any] = attr.ib(
converter=dict, default=attr.Factory(dict), validator=_validate_env_vars
)

Expand Down
14 changes: 7 additions & 7 deletions xmanager/xm/packagables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Convenience methods for constructing core objects."""

from typing import Collection, List, Mapping, Optional, Union
from typing import Any, Collection, List, Mapping, Optional, Union

import immutabledict
from xmanager.xm import executables
Expand All @@ -30,7 +30,7 @@ def binary(
dependencies: Collection[executables.BinaryDependency] = (),
*,
args: Optional[job_blocks.UserArgs] = None,
env_vars: Mapping[str, str] = immutabledict.immutabledict(),
env_vars: Mapping[str, Any] = immutabledict.immutabledict(),
) -> job_blocks.Packageable:
# pyformat: disable
"""A prebuilt executable program.
Expand Down Expand Up @@ -70,7 +70,7 @@ def bazel_binary(
bazel_args: Collection[str] = (),
*,
args: Optional[job_blocks.UserArgs] = None,
env_vars: Mapping[str, str] = immutabledict.immutabledict(),
env_vars: Mapping[str, Any] = immutabledict.immutabledict(),
) -> job_blocks.Packageable:
# pyformat: disable
"""A Bazel target that produces a self-contained binary.
Expand Down Expand Up @@ -113,7 +113,7 @@ def container(
image_path: str,
*,
args: Optional[job_blocks.UserArgs] = None,
env_vars: Mapping[str, str] = immutabledict.immutabledict(),
env_vars: Mapping[str, Any] = immutabledict.immutabledict(),
) -> job_blocks.Packageable:
# pyformat: disable
"""A prebuilt Docker image.
Expand Down Expand Up @@ -151,7 +151,7 @@ def bazel_container(
bazel_args: Collection[str] = (),
*,
args: Optional[job_blocks.UserArgs] = None,
env_vars: Mapping[str, str] = immutabledict.immutabledict(),
env_vars: Mapping[str, Any] = immutabledict.immutabledict(),
) -> job_blocks.Packageable:
# pyformat: disable
"""A Bazel target that produces a .tar image.
Expand Down Expand Up @@ -195,7 +195,7 @@ def python_container(
use_deep_module: bool = False,
*,
args: Optional[job_blocks.UserArgs] = None,
env_vars: Mapping[str, str] = immutabledict.immutabledict(),
env_vars: Mapping[str, Any] = immutabledict.immutabledict(),
) -> job_blocks.Packageable:
# pyformat: disable
"""PythonContainer describes a directory containing Python code.
Expand Down Expand Up @@ -271,7 +271,7 @@ def dockerfile_container(
dockerfile: Optional[str] = None,
*,
args: Optional[job_blocks.UserArgs] = None,
env_vars: Mapping[str, str] = immutabledict.immutabledict(),
env_vars: Mapping[str, Any] = immutabledict.immutabledict(),
) -> job_blocks.Packageable:
# pyformat: disable
"""Dockerfile describes a Dockerfile for generating a docker image.
Expand Down

0 comments on commit 48f2c35

Please sign in to comment.