Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Identifier in generate_console_url #2868

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions flytekit/remote/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -2492,6 +2492,7 @@ def generate_console_url(
FlyteWorkflow,
FlyteTask,
WorkflowExecutionIdentifier,
Identifier,
FlyteLaunchPlan,
],
):
Expand All @@ -2506,11 +2507,11 @@ def generate_console_url(
entity = entity.id
return f"{self.generate_console_http_domain()}/console/projects/{entity.project}/domains/{entity.domain}/executions/{entity.name}" # noqa

if not isinstance(entity, (FlyteWorkflow, FlyteTask, FlyteLaunchPlan)):
if not isinstance(entity, (FlyteWorkflow, FlyteTask, FlyteLaunchPlan, Identifier)):
raise ValueError(f"Only remote entities can be looked at in the console, got type {type(entity)}")
return self.generate_url_from_id(id=entity.id)

def generate_url_from_id(self, id: Identifier):
id = entity if isinstance(entity, Identifier) else entity.id

rt = "workflow"
if id.resource_type == ResourceType.TASK:
rt = "task"
Expand Down
2 changes: 1 addition & 1 deletion flytekit/tools/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _raw_register(cp_entity: FlyteControlPlaneEntity):
i = remote.raw_register(
cp_entity, serialization_settings, version=version, create_default_launchplan=False
)
console_url = remote.generate_url_from_id(id=i)
console_url = remote.generate_console_url(i)
print_activation_message = False
if is_lp and activate_launchplans:
remote.activate_launchplan(i)
Expand Down
Loading