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

refactor: Improve error handling and logging #2358

Merged
merged 5 commits into from
Apr 17, 2024
Merged

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Apr 17, 2024

Tracking issue

NA

Why are the changes needed?

It's difficult to debug since flytekit generates lots of irrelevant log messages.

What changes were proposed in this pull request?

Only print the traceback raised from the user code.

How was this patch tested?

import pandas as pd

from flytekit import task, workflow, ImageSpec, StructuredDataset

new_flytekit = "git+https://github.com/flyteorg/flytekit@44479af966f979ededd4b1aeabd1915027740231"


image = ImageSpec(registry="ghcr.io/unionai-oss", packages=["flytekitplugins-flyteinteractive"])


@task()
def t1() -> int:
    sd = StructuredDataset(uri="s3://abc")
    sd.open(pd.DataFrame).all()
    return 3 + 2


@task()
def t2() -> int:
    raise ValueError("failed")


@workflow
def wf():
    t1()
    t2()


if __name__ == "__main__":
    t1()

Screenshots

Before:

Screenshot 2024-04-16 at 9 51 59 PM Screenshot 2024-04-16 at 9 52 16 PM Screenshot 2024-04-16 at 9 52 32 PM

After:

Screenshot 2024-04-16 at 9 50 13 PM Screenshot 2024-04-16 at 9 50 25 PM Screenshot 2024-04-16 at 9 51 21 PM Screenshot 2024-04-16 at 9 53 40 PM
  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

NA

Docs link

NA

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 17, 2024
pingsutw and others added 2 commits April 16, 2024 22:38
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.31%. Comparing base (446bea0) to head (6979550).
Report is 3 commits behind head on master.

❗ Current head 6979550 differs from pull request most recent head 082ce57. Consider uploading reports for the commit 082ce57 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2358      +/-   ##
==========================================
- Coverage   95.81%   91.31%   -4.51%     
==========================================
  Files           5       61      +56     
  Lines         526     2521    +1995     
==========================================
+ Hits          504     2302    +1798     
- Misses         22      219     +197     

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

Signed-off-by: Kevin Su <[email protected]>
@dosubot dosubot bot added the lgtm This PR has been approved by maintainer label Apr 17, 2024
@kumare3 kumare3 merged commit d66da81 into master Apr 17, 2024
47 checks passed
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants