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

Pin date-time (no import of AwareDatetime) #26

Merged
merged 5 commits into from
Dec 13, 2023
Merged

Conversation

DeltaDaniel
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@lord-haffi lord-haffi left a comment

Choose a reason for hiding this comment

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

Vielleicht könntest du in der Testfunktion noch n assert am Ende reinklatschen. Sowas wie assert "datetime.datetime" in str(Angebot.model_fields["angebotsdatum"].annotation).

Btw, wenn du einen PR reviewed haben willst, solltest du ihn nicht auf "draft" stellen :) Bzw. wenn er review-fertig ist, dann auch auf GH unten den Button anklicken, damit der nicht mehr auf "draft" steht.

@@ -52,11 +54,25 @@ class BO4EDataModel(data_model_types.data_model): # type: ignore[name-defined]
setattr(_Enum, "module_path", _module_path)
setattr(_Enum, "module_name", _module_name)

class BO4EDataTypeManager(data_model_types.data_type_manager): # type: ignore[name-defined]
"""Override the data type manager to use create the namespace. -> ensures desired date-time type"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Override the data type manager to use create the namespace. -> ensures desired date-time type"""
"""
Override the data type manager to prevent the code generator from using the `AwareDateTime` type
featured in pydantic v2. Instead, the standard datetime type will be used.
"""

Copy link
Collaborator Author

@DeltaDaniel DeltaDaniel Dec 11, 2023

Choose a reason for hiding this comment

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

@DeltaDaniel DeltaDaniel marked this pull request as ready for review December 11, 2023 15:56
@DeltaDaniel DeltaDaniel merged commit c89b7f0 into main Dec 13, 2023
13 checks passed
@DeltaDaniel DeltaDaniel deleted the DDB/DateTime_NonAware branch December 13, 2023 11:26
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.

2 participants