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

raise MicrobatchModelNoEventTimeInputs warning when no microbatch input has event_time config #10929

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Oct 28, 2024

Resolves #10926

Problem

It can be unintuitive for users that they need to configure microbatch models by adding event_time fields to input models. For microbatch models with no event_time configuration, this can lead to unexpected duplicate data given it is likely not the intended use case to have microbatch but no event time filters.

Solution

Emit a warning only when no inputs to a microbatch model have an event_time config.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

🎩
Screenshot 2024-10-28 at 5 36 49 PM

@cla-bot cla-bot bot added the cla:yes label Oct 28, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@MichelleArk MichelleArk changed the title raise MicrobatchModelNoEventTimeInputs warning when no microbatch inp… raise MicrobatchModelNoEventTimeInputs warning when no microbatch input has event_time config Oct 28, 2024
def message(self) -> str:
msg = (
f"The microbatch model '{self.model_name}' has no 'ref' or 'source' input with an 'event_time' configuration. "
"This can result in unexpected duplicate records in the resulting microbatch model."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @graciegoheen for any input on the warning message

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can result in unexpected duplicate records in the resulting microbatch model.

Thoughts on this vs. "This means no filtering can be applied and can result in unexpected duplicate records in the resulting microbatch model."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better!

@MichelleArk MichelleArk marked this pull request as ready for review October 28, 2024 22:00
@MichelleArk MichelleArk requested a review from a team as a code owner October 28, 2024 22:00
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.75%. Comparing base (3224589) to head (7601b3d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10929      +/-   ##
==========================================
- Coverage   89.18%   87.75%   -1.43%     
==========================================
  Files         183      183              
  Lines       23476    23491      +15     
==========================================
- Hits        20936    20615     -321     
- Misses       2540     2876     +336     
Flag Coverage Δ
integration 84.91% <92.30%> (-1.55%) ⬇️
unit 62.07% <46.15%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.07% <46.15%> (-0.02%) ⬇️
Integration Tests 84.91% <92.30%> (-1.55%) ⬇️

Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wooooo! Thank you for taking care of this issue 🙂

@MichelleArk MichelleArk merged commit 6b5db17 into main Oct 29, 2024
57 of 60 checks passed
@MichelleArk MichelleArk deleted the microbatch-warn-when-no-event-time-config-input branch October 29, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Emit a warning if none of a microbatch model's ref/source inputs have an event_time defined
3 participants