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

bump speedate to 0.15 #1526

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ strum_macros = "0.26.4"
serde_json = {version = "1.0.132", features = ["arbitrary_precision", "preserve_order"]}
enum_dispatch = "0.3.13"
serde = { version = "1.0.214", features = ["derive"] }
speedate = "0.14.4"
speedate = "0.15.0"
smallvec = "1.13.2"
ahash = "0.8.10"
url = "2.5.0"
Expand Down
6 changes: 2 additions & 4 deletions tests/validators/test_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
pytest.param(1654646400.00, date(2022, 6, 8), id='float'),
pytest.param('1654646400.00', date(2022, 6, 8), id='float-as-str'),
pytest.param(Decimal('1654646400'), date(2022, 6, 8), id='decimal'),
# (253_402_300_800_000, Err('format YYYY-MM-DD, dates after 9999 are not supported as unix timestamps')),
pytest.param(253_402_300_800_000, Err('Input should be a valid date'), id='int-too-high'),
# (-20_000_000_000, Err('format YYYY-MM-DD, dates before 1600 are not supported as unix timestamps')),
pytest.param(-20_000_000_000, Err('Input should be a valid date'), id='int-too-low'),
pytest.param(-80_000_000_000_000, Err('Input should be a valid date'), id='int-too-low'),
pytest.param(datetime(2022, 6, 8), date(2022, 6, 8), id='datetime-exact'),
pytest.param(
datetime(2022, 6, 8, 12),
Expand Down Expand Up @@ -59,7 +57,7 @@
pytest.param(
float('-inf'),
Err(
'Input should be a valid date or datetime, dates before 1600 are not supported as unix timestamps '
'Input should be a valid date or datetime, dates before 0000 are not supported as unix timestamps '
'[type=date_from_datetime_parsing,'
),
id='-inf',
Expand Down
7 changes: 5 additions & 2 deletions tests/validators/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@
(Decimal('1654646400.1234568'), datetime(2022, 6, 8, 0, 0, 0, 123457, tzinfo=timezone.utc)),
('1654646400.1234568', datetime(2022, 6, 8, 0, 0, 0, 123457, tzinfo=timezone.utc)),
(253_402_300_800_000, Err('should be a valid datetime, dates after 9999 are not supported as unix timestamps')),
(-20_000_000_000, Err('should be a valid datetime, dates before 1600 are not supported as unix timestamps')),
(
-80_000_000_000_000,
Err('should be a valid datetime, dates before 0000 are not supported as unix timestamps'),
),
(float('nan'), Err('Input should be a valid datetime, NaN values not permitted [type=datetime_parsing,')),
(float('inf'), Err('Input should be a valid datetime, dates after 9999')),
(float('-inf'), Err('Input should be a valid datetime, dates before 1600')),
(float('-inf'), Err('Input should be a valid datetime, dates before 0000')),
('-', Err('Input should be a valid datetime or date, input is too short [type=datetime_from_date_parsing,')),
('+', Err('Input should be a valid datetime or date, input is too short [type=datetime_from_date_parsing,')),
(
Expand Down
Loading