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

Feat/di class #260

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Feat/di class #260

wants to merge 3 commits into from

Conversation

woile
Copy link
Member

@woile woile commented Dec 30, 2024

Add support for pydantic as a generic in ConsumerRecord:

class Customer(BaseModel):
    id: int

@stream_engine.stream("local--kstreams")
async def stream(cr: ConsumerRecord[str, Customer]):
    assert cr.value.id == 1

This helps with autocomplete and with faster time to market, because users don't have to manually convert

@woile woile requested a review from marcosschroh December 30, 2024 17:36
Copy link
Contributor

PR Preview Action v1.4.8
🚀 Deployed preview to https://kpn.github.io/kstreams/pr-preview/pr-260/
on branch gh-pages at 2024-12-30 17:36 UTC

Copy link

codecov bot commented Dec 30, 2024

Codecov Report

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

Project coverage is 95.85%. Comparing base (e8d4b7e) to head (3c474a9).

Files with missing lines Patch % Lines
kstreams/middleware/udf_middleware.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
+ Coverage   95.68%   95.85%   +0.17%     
==========================================
  Files          24       24              
  Lines         973      989      +16     
==========================================
+ Hits          931      948      +17     
+ Misses         42       41       -1     

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

@woile
Copy link
Member Author

woile commented Dec 30, 2024

I think we can still merge.
There's only a regression on startup time:

test_startup_and_inject_all (0003_d75800b) - Field 'mean' has failed PercentageRegressionCheck: 14.958420546 > 10.000000000

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.

1 participant