From a54bcd48220ef386d915a07b7f6ca2546a113422 Mon Sep 17 00:00:00 2001 From: rodalynbarce Date: Wed, 10 Apr 2024 11:50:38 +0100 Subject: [PATCH 1/4] Upgrade Pydantic Package Signed-off-by: rodalynbarce --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index e374bb754..748d9f3fb 100644 --- a/environment.yml +++ b/environment.yml @@ -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 From 1a1a0a51c0a1ba186133e44ef156a186ff8cb6e2 Mon Sep 17 00:00:00 2001 From: rodalynbarce Date: Wed, 10 Apr 2024 12:07:28 +0100 Subject: [PATCH 2/4] Update tests for Pydantic upgrade Signed-off-by: rodalynbarce --- tests/api/v1/test_api_circular_average.py | 4 ++-- tests/api/v1/test_api_circular_standard_deviation.py | 4 ++-- tests/api/v1/test_api_interpolate.py | 4 ++-- tests/api/v1/test_api_latest.py | 6 +++--- tests/api/v1/test_api_metadata.py | 6 +++--- tests/api/v1/test_api_raw.py | 4 ++-- tests/api/v1/test_api_resample.py | 4 ++-- tests/api/v1/test_api_sql.py | 2 +- tests/api/v1/test_api_summary.py | 4 ++-- tests/api/v1/test_api_time_weighted_average.py | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/api/v1/test_api_circular_average.py b/tests/api/v1/test_api_circular_average.py index c91e78bfb..0d4fccf63 100644 --- a/tests/api/v1/test_api_circular_average.py +++ b/tests/api/v1/test_api_circular_average.py @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_circular_standard_deviation.py b/tests/api/v1/test_api_circular_standard_deviation.py index b49acd389..a2ebac4ff 100644 --- a/tests/api/v1/test_api_circular_standard_deviation.py +++ b/tests/api/v1/test_api_circular_standard_deviation.py @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_interpolate.py b/tests/api/v1/test_api_interpolate.py index f97441f47..d08191f1b 100644 --- a/tests/api/v1/test_api_interpolate.py +++ b/tests/api/v1/test_api_interpolate.py @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_latest.py b/tests/api/v1/test_api_latest.py index f115fc673..a805823ff 100644 --- a/tests/api/v1/test_api_latest.py +++ b/tests/api/v1/test_api_latest.py @@ -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"}]}' ) @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_metadata.py b/tests/api/v1/test_api_metadata.py index 26f003ebd..653ff7223 100644 --- a/tests/api/v1/test_api_metadata.py +++ b/tests/api/v1/test_api_metadata.py @@ -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"}]}' ) @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_raw.py b/tests/api/v1/test_api_raw.py index 142ed1c98..674e93c20 100644 --- a/tests/api/v1/test_api_raw.py +++ b/tests/api/v1/test_api_raw.py @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_resample.py b/tests/api/v1/test_api_resample.py index fb8369738..aa428c73e 100644 --- a/tests/api/v1/test_api_resample.py +++ b/tests/api/v1/test_api_resample.py @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_sql.py b/tests/api/v1/test_api_sql.py index 167d38ec9..2b52d9f7b 100644 --- a/tests/api/v1/test_api_sql.py +++ b/tests/api/v1/test_api_sql.py @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_summary.py b/tests/api/v1/test_api_summary.py index 7804badf8..5b44b31bf 100644 --- a/tests/api/v1/test_api_summary.py +++ b/tests/api/v1/test_api_summary.py @@ -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"}]}' ) @@ -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"}]}' ) diff --git a/tests/api/v1/test_api_time_weighted_average.py b/tests/api/v1/test_api_time_weighted_average.py index f308084fc..d9b1f40ab 100644 --- a/tests/api/v1/test_api_time_weighted_average.py +++ b/tests/api/v1/test_api_time_weighted_average.py @@ -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"}]}' ) @@ -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"}]}' ) From b6c7da5618d481649516299b1ae3f9e3a7995206 Mon Sep 17 00:00:00 2001 From: rodalynbarce Date: Thu, 11 Apr 2024 09:59:22 +0100 Subject: [PATCH 3/4] Upgrade pydantic Signed-off-by: rodalynbarce --- src/api/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/requirements.txt b/src/api/requirements.txt index 0ffb70685..6d80ad256 100644 --- a/src/api/requirements.txt +++ b/src/api/requirements.txt @@ -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 From 03b8d968530732c2c289156ac2ddb9ecdd170284 Mon Sep 17 00:00:00 2001 From: rodalynbarce Date: Thu, 11 Apr 2024 10:06:08 +0100 Subject: [PATCH 4/4] Upgrade pydantic Signed-off-by: rodalynbarce --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 164ae732f..cc25ce19f 100644 --- a/setup.py +++ b/setup.py @@ -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 = [