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

fix datetime in eager workflow #2541

Merged
merged 3 commits into from
Jul 4, 2024
Merged
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
12 changes: 10 additions & 2 deletions flytekit/experimental/eager_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@
self.async_stack.set_node(node)

poll_interval = self._poll_interval or timedelta(seconds=30)
time_to_give_up = datetime.max if self._timeout is None else datetime.now(timezone.utc) + self._timeout
time_to_give_up = (

Check warning on line 182 in flytekit/experimental/eager_function.py

View check run for this annotation

Codecov / codecov/patch

flytekit/experimental/eager_function.py#L182

Added line #L182 was not covered by tests
(datetime.max.replace(tzinfo=timezone.utc))
if self._timeout is None
else datetime.now(timezone.utc) + self._timeout
)

while datetime.now(timezone.utc) < time_to_give_up:
execution = self.remote.sync(execution)
Expand Down Expand Up @@ -208,7 +212,11 @@
)

poll_interval = self._poll_interval or timedelta(seconds=6)
time_to_give_up = datetime.max if self._timeout is None else datetime.now(timezone.utc) + self._timeout
time_to_give_up = (

Check warning on line 215 in flytekit/experimental/eager_function.py

View check run for this annotation

Codecov / codecov/patch

flytekit/experimental/eager_function.py#L215

Added line #L215 was not covered by tests
(datetime.max.replace(tzinfo=timezone.utc))
if self._timeout is None
else datetime.now(timezone.utc) + self._timeout
)

while datetime.now(timezone.utc) < time_to_give_up:
execution = self.remote.sync(execution)
Expand Down
Loading