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

Conversation

novahow
Copy link
Contributor

@novahow novahow commented Jun 30, 2024

Tracking issue

Why are the changes needed?

[3/3] currentAttempt done. Last Error: SYSTEM::Traceback (most recent call last):
  File "/flytekit/flytekit/bin/entrypoint.py", line 103, in _dispatch_execute
    outputs = asyncio.run(outputs)
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/flytekit/flytekit/core/base_task.py", line 666, in _async_execute
    native_outputs = await native_outputs
  File "/flytekit/flytekit/experimental/eager_function.py", line 517, in wrapper
    out = await _fn(*args, **kws)
  File "/root/test_async.py", line 68, in simple_async_workflow
    res = await coro
  File "/flytekit/flytekit/experimental/eager_function.py", line 184, in __call__
    while datetime.now(timezone.utc) < time_to_give_up:
TypeError: can't compare offset-naive and offset-aware datetimes

datetime comparison is wrong when using eager_workflows

What changes were proposed in this pull request?

changed datetime.max as timezone-aware datetime and prevented timestamp overflow by subtracting 2 days.

How was this patch tested?

pytest --pdb -x tests/flytekit/unit/experimental/test_eager_workflows.py -s

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

novahow added 2 commits June 30, 2024 18:41
Signed-off-by: novahow <b08902047@ntu.edu.tw>
Signed-off-by: novahow <b08902047@ntu.edu.tw>
@novahow novahow changed the title fix datetime offset fix datetime in eager workflow Jun 30, 2024
Signed-off-by: novahow <b08902047@ntu.edu.tw>
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.55%. Comparing base (2719b34) to head (298d798).
Report is 14 commits behind head on master.

Files Patch % Lines
flytekit/experimental/eager_function.py 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (2719b34) and HEAD (298d798). Click for more details.

HEAD has 13 uploads less than BASE
Flag BASE (2719b34) HEAD (298d798)
15 2
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2541      +/-   ##
==========================================
- Coverage   77.65%   72.55%   -5.10%     
==========================================
  Files         236      183      -53     
  Lines       20789    18726    -2063     
  Branches     3661     3695      +34     
==========================================
- Hits        16144    13587    -2557     
- Misses       4017     4487     +470     
- Partials      628      652      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pingsutw pingsutw merged commit a728506 into flyteorg:master Jul 4, 2024
46 of 48 checks passed
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
Signed-off-by: novahow <b08902047@ntu.edu.tw>
Signed-off-by: Jan Fiedler <jan@union.ai>
mao3267 pushed a commit to mao3267/flytekit that referenced this pull request Jul 29, 2024
Signed-off-by: novahow <b08902047@ntu.edu.tw>
Signed-off-by: mao3267 <chenvincent610@gmail.com>
@novahow novahow deleted the test/grpctest branch December 13, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants