Epoch - unix timestamp - #240
Merged
Merged
Conversation
using type float, format: date-time to serialize datetime.datetime
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 11 20 +9
Lines 685 1085 +400
Branches 169 257 +88
==========================================
+ Hits 685 1085 +400 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
tests/test_epoch.py:5: in <module>
from pydantic_extra_types import epoch
pydantic_extra_types/epoch.py:12: in <module>
class _Base(datetime.datetime):
pydantic_extra_types/epoch.py:27: in _Base
cls, source: type[Any], handler: Callable[[Any], CoreSchema]
E TypeError: 'type' object is not subscriptable
yezz123
requested changes
Nov 19, 2024
yezz123
left a comment
Collaborator
There was a problem hiding this comment.
Hello @commonism Thank you for your PR 🙌🏻
I have two little comments one for the docstring & the other one for adding the JSON schema test here: https://github.com/pydantic/pydantic-extra-types/blob/main/tests/test_json_schema.py
yezz123
pushed a commit
that referenced
this pull request
Nov 21, 2024
yezz123
added a commit
that referenced
this pull request
Nov 26, 2024
* ♻️ Migrate Pydantic Extra Types to use uv * ♻️ Update CI workflow and Makefile to remove pyright and install extra dependencies * ♻️ Update CI workflow to use uv for installing extra dependencies and remove typecheck from pre-commit config * ✨ add new type: Epoch Unix Timestamp (#240) * ✨ Fix formatting in epoch.py log entry comment * 🎨 Add blank line for improved readability in epoch * ♻️ Refactor dependency management in pyproject.toml and Makefile; update CI workflow for improved linting and coverage * ♻️ Refactor CI workflow and dependency management; unify optional dependencies under 'all' and 'extra' * ✨ Add step to install all extra dependencies in CI workflow --------- Co-authored-by: commonism <commonism@users.noreply.github.com>
commonism
added a commit
to commonism/aiopenapi3
that referenced
this pull request
Nov 29, 2024
have a datatype for epoch datetimes type:integer/number with format:date-time is datetime c.f. pydantic/pydantic-extra-types#240
commonism
added a commit
to commonism/aiopenapi3
that referenced
this pull request
Nov 29, 2024
* v20/v3x - epoch datetime values have a datatype for epoch datetimes type:integer/number with format:date-time is datetime c.f. pydantic/pydantic-extra-types#240
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
using type float, format: date-time to serialize datetime.datetime
fix #238