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

Upgrade pydantic to 2.6.0 #719

Merged
merged 4 commits into from
Apr 18, 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
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies:
- semver==3.0.0
- xlrd==2.0.1
- pygithub==1.59.0
- pydantic==2.4.2
- pydantic==2.6.0
- pyjwt==2.8.0
- web3==6.5.0
- twine==4.0.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"googleapis-common-protos>=1.56.4",
"langchain==0.1.11",
"openai==1.13.3",
"pydantic==2.4.2",
"pydantic==2.6.0",
]

PYSPARK_PACKAGES = [
Expand Down
2 changes: 1 addition & 1 deletion src/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Do not include azure-functions-worker as it may conflict with the Azure Functions platform
azure-functions==1.18.0
fastapi==0.110.0
pydantic==2.4.2
pydantic==2.6.0
# turbodbc==4.11.0
pyodbc==4.0.39
importlib_metadata>=1.0.0
Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_circular_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def test_api_circular_average_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -138,7 +138,7 @@ async def test_api_circular_average_post_validation_error(mocker: MockerFixture)
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_circular_standard_deviation.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def test_api_circular_standard_deviation_get_validation_error(
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -144,7 +144,7 @@ async def test_api_circular_standard_deviation_post_validation_error(
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def test_api_interpolate_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -138,7 +138,7 @@ async def test_api_interpolate_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
6 changes: 3 additions & 3 deletions tests/api/v1/test_api_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def test_api_latest_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -251,7 +251,7 @@ async def test_api_latest_post_no_tags_provided_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["body"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["body"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -283,7 +283,7 @@ async def test_api_latest_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
6 changes: 3 additions & 3 deletions tests/api/v1/test_api_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def test_api_metadata_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -143,7 +143,7 @@ async def test_api_metadata_post_no_tags_provided_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["body"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["body"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand All @@ -162,7 +162,7 @@ async def test_api_metadata_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","business_unit"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def test_api_raw_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -162,7 +162,7 @@ async def test_api_raw_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def test_api_resample_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -134,7 +134,7 @@ async def test_api_resample_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
2 changes: 1 addition & 1 deletion tests/api/v1/test_api_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def test_api_raw_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["body","sql_statement"],"msg":"Field required","input":{},"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["body","sql_statement"],"msg":"Field required","input":{},"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def test_api_summary_get_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -132,7 +132,7 @@ async def test_api_summary_post_validation_error(mocker: MockerFixture):
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
4 changes: 2 additions & 2 deletions tests/api/v1/test_api_time_weighted_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def test_api_time_weighted_average_get_validation_error(mocker: MockerFixt
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down Expand Up @@ -142,7 +142,7 @@ async def test_api_time_weighted_average_post_validation_error(mocker: MockerFix
assert response.status_code == 422
assert (
actual
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.4/v/missing"}]}'
== '{"detail":[{"type":"missing","loc":["query","start_date"],"msg":"Field required","input":null,"url":"https://errors.pydantic.dev/2.6/v/missing"}]}'
)


Expand Down
Loading