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

Add a test for union/dc #3074

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a test for union/dc #3074

wants to merge 1 commit into from

Conversation

wild-endeavor
Copy link
Contributor

@wild-endeavor wild-endeavor commented Jan 22, 2025

  • Just adding a unit test we found helpful when debugging.
  • Updating new lines to not annoy some IDEs.

Summary by Bito

Added new unit test for validating Union type behavior with dataclass_json decorated classes in Flytekit. Test specifically focuses on Union[DC, DCWithOptional] functionality in both task and workflow contexts, verifying proper serialization and deserialization based on conditional logic.

Unit tests added: True

Estimated effort to review (1-5, lower is better): 1

Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
@flyte-bot
Copy link
Contributor

flyte-bot commented Jan 22, 2025

Code Review Agent Run #a6d711

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 421479c..421479c
    • tests/flytekit/unit/core/test_dataclass.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Contributor

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Testing - Unit Test for DataClass Union Types

test_dataclass.py - Added test cases for Union type handling with dataclass_json decorated classes

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.95%. Comparing base (3260ddf) to head (421479c).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (3260ddf) and HEAD (421479c). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (3260ddf) HEAD (421479c)
5 3
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3074      +/-   ##
==========================================
- Coverage   82.21%   75.95%   -6.26%     
==========================================
  Files         202      202              
  Lines       21430    21430              
  Branches     2760     2760              
==========================================
- Hits        17618    16277    -1341     
- Misses       3011     4350    +1339     
- Partials      801      803       +2     

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

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.

3 participants