Skip to content

[GSK-1745] Support both Pydantic 1 & 2#1401

Merged
Hartorn merged 6 commits intomainfrom
feature/gsk-1745-upgrade-pydantic-to-20
Sep 22, 2023
Merged

[GSK-1745] Support both Pydantic 1 & 2#1401
Hartorn merged 6 commits intomainfrom
feature/gsk-1745-upgrade-pydantic-to-20

Conversation

@Hartorn
Copy link
Copy Markdown
Member

@Hartorn Hartorn commented Sep 14, 2023

Description

Major issues encountered :

  • base settings is in a different package for pydantic v2
    • handling it with extra deps was not working, since pdm was not installing it
    • since it's used only in one class, just doing the behaviour by hand
  • validate_arguments was renamed validate_call in pydantic v2
  • validate_call works only on types, so was creating issues to pickle code on SlicingFunction, TransformationFunction, and test decorator
  • validate_call has been moved inside decorator

Everything else is only minor changes to enforce types and respect pydantic validation

@linear
Copy link
Copy Markdown

linear Bot commented Sep 14, 2023

GSK-1745 Upgrade pydantic to 2.0+

Several users have faced dependency issues because of our strict requirement for pydantic versions. Need to investigate what it takes to do this. Possible issue: libraries we rely on might still rely on older versions of pydantic

@Hartorn Hartorn self-assigned this Sep 14, 2023
@Hartorn Hartorn force-pushed the feature/gsk-1745-upgrade-pydantic-to-20 branch 19 times, most recently from 83d7469 to 9e870db Compare September 19, 2023 12:48
@Hartorn Hartorn marked this pull request as ready for review September 19, 2023 13:42
@Hartorn Hartorn requested a review from a team September 19, 2023 13:42
@Hartorn Hartorn force-pushed the feature/gsk-1745-upgrade-pydantic-to-20 branch 3 times, most recently from 8fd1ae6 to df20765 Compare September 21, 2023 14:13
@Hartorn Hartorn requested a review from Inokinoki September 22, 2023 07:40
Comment thread python-client/giskard/ml_worker/testing/registry/slicing_function.py Outdated
Comment thread python-client/giskard/settings.py Outdated
Comment thread python-client/tests/llm/test_talk.py
Comment thread python-client/tests/scan/test_performance_bias_detector.py
Comment thread python-client/tests/scan/test_performance_bias_detector.py
Comment thread python-client/giskard/core/validation.py Outdated
Comment thread python-client/giskard/llm/talk/talk.py
Comment thread python-client/giskard/models/base/model.py
Comment thread python-client/giskard/ml_worker/testing/registry/slicing_function.py Outdated
Comment thread python-client/giskard/settings.py Outdated
Comment thread python-client/giskard/settings.py Outdated
@Hartorn Hartorn force-pushed the feature/gsk-1745-upgrade-pydantic-to-20 branch from 15f418b to c467382 Compare September 22, 2023 09:07
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Hartorn Hartorn merged commit 98f8d2c into main Sep 22, 2023
@Hartorn Hartorn deleted the feature/gsk-1745-upgrade-pydantic-to-20 branch September 22, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants