Skip to content

Commit

Permalink
added LEGACY_SINGLE_USER_STANDARD, and removed deprecated field
Browse files Browse the repository at this point in the history
  • Loading branch information
stikkireddy committed Jan 10, 2024
1 parent 805f448 commit 1efbbef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 4 additions & 2 deletions brickflow/bundles/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,14 @@ class Config:
'LEGACY_TABLE_ACL',
'LEGACY_PASSTHROUGH',
'LEGACY_SINGLE_USER',
'LEGACY_SINGLE_USER_STANDARD',
'SINGLE_USER',
'USER_ISOLATION',
'NONE',
]
] = Field(
'SINGLE_USER',
description='The data security mode to use for clusters. Valid values are ["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "SINGLE_USER", "USER_ISOLATION", "NONE"].',
description='The data security mode to use for clusters. Valid values are ["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "SINGLE_USER", "USER_ISOLATION", "NONE"].',
)
docker_image: Optional[JobsJobClustersNewClusterDockerImage] = None
driver_instance_pool_id: Optional[str] = Field(
Expand Down Expand Up @@ -1138,13 +1139,14 @@ class Config:
'LEGACY_TABLE_ACL',
'LEGACY_PASSTHROUGH',
'LEGACY_SINGLE_USER',
'LEGACY_SINGLE_USER_STANDARD',
'SINGLE_USER',
'USER_ISOLATION',
'NONE',
]
] = Field(
'SINGLE_USER',
description='The data security mode to use for clusters. Valid values are ["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "SINGLE_USER", "USER_ISOLATION", "NONE"].',
description='The data security mode to use for clusters. Valid values are ["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "SINGLE_USER", "USER_ISOLATION", "NONE"].',
)
docker_image: Optional[JobsTasksNewClusterDockerImage] = None
driver_instance_pool_id: Optional[str] = Field(
Expand Down
10 changes: 6 additions & 4 deletions brickflow/cli/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from brickflow.cli.commands import exec_command
from brickflow.cli.configure import get_entrypoint, log_important_versions

ENV_FLAG = "-t"


def pre_bundle_hook(f: Callable[..., Any]) -> Callable[..., Any]:
@functools.wraps(f)
Expand Down Expand Up @@ -49,7 +51,7 @@ def bundle_validate(bundle_cli: Optional[str] = None, **_: Any) -> None:
exec_command(
get_valid_bundle_cli(bundle_cli),
"bundle",
["validate", "-e", brickflow_ctx.env],
["validate", ENV_FLAG, brickflow_ctx.env],
)


Expand Down Expand Up @@ -78,7 +80,7 @@ def bundle_sync(
exec_command(
get_valid_bundle_cli(bundle_cli),
"bundle",
["sync", "-e", get_bundles_project_env(), *additional_args],
["sync", ENV_FLAG, get_bundles_project_env(), *additional_args],
)


Expand All @@ -99,7 +101,7 @@ def bundle_deploy(
bundle_cli: Optional[str] = None, force_acquire_lock: bool = False, **_: Any
) -> None:
"""CLI deploy the bundle."""
deploy_args = ["deploy", "-e", get_bundles_project_env()]
deploy_args = ["deploy", ENV_FLAG, get_bundles_project_env()]
if force_acquire_lock is True:
# fix/issue-32
deploy_args.append(get_force_lock_flag())
Expand All @@ -114,7 +116,7 @@ def bundle_destroy(
**_: Any,
) -> None:
"""CLI destroy the bundle."""
destroy_args = ["destroy", "-e", get_bundles_project_env()]
destroy_args = ["destroy", ENV_FLAG, get_bundles_project_env()]
if auto_approve is True:
destroy_args.append("--auto-approve")
if force_acquire_lock is True:
Expand Down
8 changes: 4 additions & 4 deletions tests/cli/test_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def test_bundle_deploy_new_cli(self, mock_exec_command: Mock):
mock_exec_command.assert_called_with(
bundle_cli,
"bundle",
["deploy", "-e", "local", "--force-lock"],
["deploy", "-t", "local", "--force-lock"],
)
bundle_destroy(force_acquire_lock=True, workflows_dir="somedir")
bundle_cli = os.environ[BrickflowEnvVars.BRICKFLOW_BUNDLE_CLI_EXEC.value]
mock_exec_command.assert_called_with(
bundle_cli,
"bundle",
["destroy", "-e", "local", "--force-lock"],
["destroy", "-t", "local", "--force-lock"],
)

@patch("brickflow.cli.bundles.exec_command")
Expand All @@ -46,12 +46,12 @@ def test_bundle_deploy_old_cli(self, mock_exec_command: Mock):
mock_exec_command.assert_called_with(
bundle_cli,
"bundle",
["deploy", "-e", "local", "--force"],
["deploy", "-t", "local", "--force"],
)
bundle_destroy(force_acquire_lock=True, workflows_dir="somedir")
bundle_cli = os.environ[BrickflowEnvVars.BRICKFLOW_BUNDLE_CLI_EXEC.value]
mock_exec_command.assert_called_with(
bundle_cli,
"bundle",
["destroy", "-e", "local", "--force"],
["destroy", "-t", "local", "--force"],
)
4 changes: 3 additions & 1 deletion tools/modify_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def apply_patch(self, definitions):
),
# Update from ["SINGLE_USER", "USER_ISOLATION", "NONE"] to
# ["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "SINGLE_USER", "USER_ISOLATION", "NONE"]
# LEGACY_SINGLE_USER_STANDARD is not documented but supported
# Jan 8, 2024 no breaking changes as its adding new optional enums
*[
SchemaPatch(
Expand All @@ -63,12 +64,13 @@ def apply_patch(self, definitions):
"LEGACY_TABLE_ACL",
"LEGACY_PASSTHROUGH",
"LEGACY_SINGLE_USER",
"LEGACY_SINGLE_USER_STANDARD",
"SINGLE_USER",
"USER_ISOLATION",
"NONE",
],
"description": "The data security mode to use for clusters. Valid values are "
'["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", '
'["LEGACY_TABLE_ACL", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", '
'"SINGLE_USER", "USER_ISOLATION", "NONE"].',
},
)
Expand Down

0 comments on commit 1efbbef

Please sign in to comment.