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

Migrate to Pydantic v2 #347

Merged
merged 106 commits into from
Dec 12, 2023
Merged

Migrate to Pydantic v2 #347

merged 106 commits into from
Dec 12, 2023

Conversation

sujuka99
Copy link
Contributor

closes #341

@sujuka99 sujuka99 added type/refactor Refactoring of existing functionality type/update Update dependencies area/dependencies Relates to project dependencies labels Aug 30, 2023
@sujuka99 sujuka99 added this to the Hardening KPOps milestone Aug 30, 2023
@sujuka99 sujuka99 self-assigned this Aug 30, 2023
@disrupted disrupted changed the title Migrate to pydantic v2 Migrate to Pydantic v2 Aug 30, 2023
kpops/utils/pydantic.py Outdated Show resolved Hide resolved
@sujuka99
Copy link
Contributor Author

sujuka99 commented Nov 8, 2023

Closes #20 ?

Not if we want full support (loading all env vars from the file)

I believe Pydantic doesn't export the variables in the dotenv file to os.env, but instead directly reads only the settings from it.

Relevant issue

I am pretty sure that adding the support for everything else wouldn't be hard, but I would prefer to do it in another PR.

@sujuka99
Copy link
Contributor Author

sujuka99 commented Nov 9, 2023

credit: @disrupted

Problems found during testing on real projects:

  1. app.streams.config is forced to have string values now, e.g. max.poll.records: 100 is not possible anymore (Must be fixed now)
  2. Dry-run error: RuntimeError: Error: release name is invalid: wordwordwo-word-wordwordwordw-wordw-wordwor-wordwordwo. That release name should be automatically trimmed if it's over the character limit.

kpops/components/base_components/kafka_connector.py Outdated Show resolved Hide resolved
kpops/utils/dict_ops.py Outdated Show resolved Hide resolved
Copy link
Member

@disrupted disrupted left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@sujuka99 sujuka99 merged commit 74ffd6e into v3 Dec 12, 2023
6 of 7 checks passed
@sujuka99 sujuka99 deleted the refactor/pydantic-v2 branch December 12, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Relates to project dependencies type/refactor Refactoring of existing functionality type/update Update dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to Pydantic v2
2 participants