Skip to content

Fix broken run_notebooks GH action #1176

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

Merged
merged 1 commit into from
Apr 5, 2023
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
2 changes: 1 addition & 1 deletion examples/run_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def extract_credential(credential_prefix: str) -> str:

# A flow has been successfully published if it makes at least one successful workflow run since start_time,
flow_runs = [flow.fetch(flow_run_dict["run_id"]) for flow_run_dict in flow.list_runs()]
flow_runs = [flow_run for flow_run in flow_runs if float(flow_run._created_at) > start_time]
flow_runs = [flow_run for flow_run in flow_runs if flow_run.created_at() > start_time]
if len(flow_runs) == 0:
continue

Expand Down
11 changes: 10 additions & 1 deletion sdk/aqueduct/flow_run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import textwrap
import uuid
from datetime import datetime
from typing import Optional

from aqueduct.artifacts import (
Expand Down Expand Up @@ -63,6 +64,14 @@ def status(self) -> ExecutionStatus:
"""Returns the status of the flow run."""
return self._dag_result_resp.result.exec_state.status

def _created_at(self) -> datetime:
"""Returns the datetime at which the flow run was created."""
return self._dag_result_resp.dag_created_at

def created_at(self) -> float:
"""Returns the unix timestamp at which the flow run was created."""
return self._created_at().timestamp()

def describe(self) -> None:
"""Prints out a human-readable description of the flow run."""
url = generate_ui_url(
Expand All @@ -76,7 +85,7 @@ def describe(self) -> None:
f"""
{format_header_for_print(f"'{self._dag.metadata.name}' Run")}
ID: {self._id}
Created At (UTC): {self._dag_result_resp.dag_created_at.strftime(TIME_FORMAT)}
Created At (UTC): {self._created_at().strftime(TIME_FORMAT)}
Status: {str(self.status())}
UI: {url}
"""
Expand Down