diff --git a/.github/workflows/python-wrapper-unit-tests.yaml b/.github/workflows/python-wrapper-unit-tests.yaml index 116abe2ae5a..6b820f8cde1 100644 --- a/.github/workflows/python-wrapper-unit-tests.yaml +++ b/.github/workflows/python-wrapper-unit-tests.yaml @@ -32,6 +32,10 @@ jobs: unit-tests: needs: paths-filter if: ${{ needs.paths-filter.outputs.client-change == 'true' }} + strategy: + fail-fast: false + matrix: + pydantic_v1: [ true, false ] name: Unit Test Python SDK Wrapper runs-on: ubuntu-22.04 steps: @@ -43,6 +47,11 @@ jobs: with: python-version: 3.9 + # When installed it will skip the installation of pydantic in the next step which will install the latest > 2 + - name: Install pydantic V1 + if: matrix.pydantic_v1 + run: pip install pydantic==1.10.6 + - name: Install dependencies working-directory: ./clients/python-wrapper run: pip install -r requirements.txt pylint pytest pytest-md pytest-emoji diff --git a/Makefile b/Makefile index 578abacbf11..f5ca995b8c6 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ OPENAPI_LEGACY_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v5.3.0 OPENAPI_LEGACY_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_LEGACY_GENERATOR_IMAGE) OPENAPI_GENERATOR_IMAGE=treeverse/openapi-generator-cli:v7.0.0.1 OPENAPI_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_GENERATOR_IMAGE) +PY_OPENAPI_GENERATOR=$(DOCKER) run -e PYTHON_POST_PROCESS_FILE="/mnt/clients/python/scripts/pydantic.sh" --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_GENERATOR_IMAGE) GOLANGCI_LINT_VERSION=v1.53.3 BUF_CLI_VERSION=v1.28.1 @@ -128,8 +129,9 @@ sdk-python-legacy: api/swagger.yml ## Generate SDK for Python client - openapi sdk-python: api/swagger.yml ## Generate SDK for Python client - openapi generator version 7.0.0 # remove the build folder as it also holds lakefs_sdk folder which keeps because we skip it during find rm -rf clients/python/build; cd clients/python && \ - find . -depth -name lakefs_sdk -prune -o ! \( -name Gemfile -or -name Gemfile.lock -or -name _config.yml -or -name .openapi-generator-ignore -or -name templates -or -name setup.mustache -or -name client.mustache -or -name python-codegen-config.yaml \) -delete - $(OPENAPI_GENERATOR) generate \ + find . -depth -name lakefs_sdk -prune -o ! \( -name Gemfile -or -name Gemfile.lock -or -name _config.yml -or -name .openapi-generator-ignore -or -name templates -or -name setup.mustache -or -name client.mustache -or -name requirements.mustache -or -name scripts -or -name pydantic.sh -or -name python-codegen-config.yaml \) -delete + $(PY_OPENAPI_GENERATOR) generate \ + --enable-post-process-file \ -i /mnt/$< \ -g python \ -t /mnt/clients/python/templates \ diff --git a/clients/python-wrapper/requirements.txt b/clients/python-wrapper/requirements.txt index 0df424a0e2f..8eb7b227e5a 100644 --- a/clients/python-wrapper/requirements.txt +++ b/clients/python-wrapper/requirements.txt @@ -1,6 +1,5 @@ aenum~=3.1.15 lakefs-sdk>=1.16.0 -pydantic >= 1.10.5, < 2 python-dateutil~=2.8.2 PyYAML~=6.0.1 six~=1.16.0 diff --git a/clients/python-wrapper/setup.py b/clients/python-wrapper/setup.py index 59025a8011e..9b1c16fbaf4 100644 --- a/clients/python-wrapper/setup.py +++ b/clients/python-wrapper/setup.py @@ -11,7 +11,6 @@ PYTHON_REQUIRES = ">=3.9" REQUIRES = [ - "pydantic >= 1.10.5, < 2", "setuptools == 68.2.2", "lakefs-sdk ~= 1.0", "pyyaml ~= 6.0.1", diff --git a/clients/python-wrapper/tests/integration/README.md b/clients/python-wrapper/tests/integration/README.md index 7e26122b413..3097be12760 100644 --- a/clients/python-wrapper/tests/integration/README.md +++ b/clients/python-wrapper/tests/integration/README.md @@ -27,11 +27,11 @@ From the clients/python-wrapper directory: ```sh python3 -m venv source /bin/activate -pip install -r requirements pylint +pip install -r requirements ``` ## Run Tests ```sh -pylint tests +pytest tests ``` diff --git a/clients/python-wrapper/tests/integration/test_branch.py b/clients/python-wrapper/tests/integration/test_branch.py index 9797d493eb7..7caa0ea07a0 100644 --- a/clients/python-wrapper/tests/integration/test_branch.py +++ b/clients/python-wrapper/tests/integration/test_branch.py @@ -1,5 +1,9 @@ import pytest -from pydantic import ValidationError + +try: + from pydantic.v1 import ValidationError +except ImportError: + from pydantic import ValidationError import lakefs from lakefs.exceptions import NotFoundException, TransactionException diff --git a/clients/python/lakefs_sdk/api/actions_api.py b/clients/python/lakefs_sdk/api/actions_api.py index f60b970d603..c5e7dd69376 100644 --- a/clients/python/lakefs_sdk/api/actions_api.py +++ b/clients/python/lakefs_sdk/api/actions_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +try: + from pydantic.v1 import Field, StrictStr, conint +except ImportError: + from pydantic import Field, StrictStr, conint from typing import Optional, Union diff --git a/clients/python/lakefs_sdk/api/auth_api.py b/clients/python/lakefs_sdk/api/auth_api.py index d289979a193..a5621dc4b4d 100644 --- a/clients/python/lakefs_sdk/api/auth_api.py +++ b/clients/python/lakefs_sdk/api/auth_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint +try: + from pydantic.v1 import Field, StrictBool, StrictStr, conint +except ImportError: + from pydantic import Field, StrictBool, StrictStr, conint from typing import Optional diff --git a/clients/python/lakefs_sdk/api/branches_api.py b/clients/python/lakefs_sdk/api/branches_api.py index ffb552796e2..b17a83d0342 100644 --- a/clients/python/lakefs_sdk/api/branches_api.py +++ b/clients/python/lakefs_sdk/api/branches_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint +try: + from pydantic.v1 import Field, StrictBool, StrictStr, conint +except ImportError: + from pydantic import Field, StrictBool, StrictStr, conint from typing import Optional diff --git a/clients/python/lakefs_sdk/api/commits_api.py b/clients/python/lakefs_sdk/api/commits_api.py index 02bea4c6a84..4e8450304b6 100644 --- a/clients/python/lakefs_sdk/api/commits_api.py +++ b/clients/python/lakefs_sdk/api/commits_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +try: + from pydantic.v1 import Field, StrictStr +except ImportError: + from pydantic import Field, StrictStr from typing import Optional diff --git a/clients/python/lakefs_sdk/api/config_api.py b/clients/python/lakefs_sdk/api/config_api.py index 028f68fcd36..eb2132da2fa 100644 --- a/clients/python/lakefs_sdk/api/config_api.py +++ b/clients/python/lakefs_sdk/api/config_api.py @@ -17,7 +17,10 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated from lakefs_sdk.models.config import Config diff --git a/clients/python/lakefs_sdk/api/experimental_api.py b/clients/python/lakefs_sdk/api/experimental_api.py index 66ffe65c9a0..2df5e2d6f68 100644 --- a/clients/python/lakefs_sdk/api/experimental_api.py +++ b/clients/python/lakefs_sdk/api/experimental_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr, conint +try: + from pydantic.v1 import Field, StrictBool, StrictInt, StrictStr, conint +except ImportError: + from pydantic import Field, StrictBool, StrictInt, StrictStr, conint from typing import Optional diff --git a/clients/python/lakefs_sdk/api/external_api.py b/clients/python/lakefs_sdk/api/external_api.py index 8b5462faff2..6f905491490 100644 --- a/clients/python/lakefs_sdk/api/external_api.py +++ b/clients/python/lakefs_sdk/api/external_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +try: + from pydantic.v1 import Field, StrictStr, conint +except ImportError: + from pydantic import Field, StrictStr, conint from typing import Optional diff --git a/clients/python/lakefs_sdk/api/health_check_api.py b/clients/python/lakefs_sdk/api/health_check_api.py index 87fe982c84f..822c1592777 100644 --- a/clients/python/lakefs_sdk/api/health_check_api.py +++ b/clients/python/lakefs_sdk/api/health_check_api.py @@ -17,7 +17,10 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated diff --git a/clients/python/lakefs_sdk/api/import_api.py b/clients/python/lakefs_sdk/api/import_api.py index 4e0b25708f3..0ab12b3a302 100644 --- a/clients/python/lakefs_sdk/api/import_api.py +++ b/clients/python/lakefs_sdk/api/import_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +try: + from pydantic.v1 import Field, StrictStr +except ImportError: + from pydantic import Field, StrictStr from lakefs_sdk.models.import_creation import ImportCreation from lakefs_sdk.models.import_creation_response import ImportCreationResponse diff --git a/clients/python/lakefs_sdk/api/internal_api.py b/clients/python/lakefs_sdk/api/internal_api.py index 0febc0689d2..d59b6c7997a 100644 --- a/clients/python/lakefs_sdk/api/internal_api.py +++ b/clients/python/lakefs_sdk/api/internal_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictStr +try: + from pydantic.v1 import Field, StrictStr +except ImportError: + from pydantic import Field, StrictStr from typing import List, Optional diff --git a/clients/python/lakefs_sdk/api/metadata_api.py b/clients/python/lakefs_sdk/api/metadata_api.py index f897ec3b550..b23da8cbe32 100644 --- a/clients/python/lakefs_sdk/api/metadata_api.py +++ b/clients/python/lakefs_sdk/api/metadata_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import StrictStr +try: + from pydantic.v1 import StrictStr +except ImportError: + from pydantic import StrictStr from lakefs_sdk.models.storage_uri import StorageURI diff --git a/clients/python/lakefs_sdk/api/objects_api.py b/clients/python/lakefs_sdk/api/objects_api.py index 11a5229f3b6..50c43248b80 100644 --- a/clients/python/lakefs_sdk/api/objects_api.py +++ b/clients/python/lakefs_sdk/api/objects_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator +try: + from pydantic.v1 import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator +except ImportError: + from pydantic import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator from typing import Optional, Union diff --git a/clients/python/lakefs_sdk/api/refs_api.py b/clients/python/lakefs_sdk/api/refs_api.py index abc0529b5f8..58084c36a40 100644 --- a/clients/python/lakefs_sdk/api/refs_api.py +++ b/clients/python/lakefs_sdk/api/refs_api.py @@ -17,12 +17,18 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated from datetime import datetime -from pydantic import Field, StrictBool, StrictStr, conint, conlist +try: + from pydantic.v1 import Field, StrictBool, StrictStr, conint, conlist +except ImportError: + from pydantic import Field, StrictBool, StrictStr, conint, conlist from typing import Optional diff --git a/clients/python/lakefs_sdk/api/repositories_api.py b/clients/python/lakefs_sdk/api/repositories_api.py index a2ebd9e58f2..f31d2c1d818 100644 --- a/clients/python/lakefs_sdk/api/repositories_api.py +++ b/clients/python/lakefs_sdk/api/repositories_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, conlist +try: + from pydantic.v1 import Field, StrictBool, StrictStr, conint, conlist +except ImportError: + from pydantic import Field, StrictBool, StrictStr, conint, conlist from typing import Dict, List, Optional diff --git a/clients/python/lakefs_sdk/api/staging_api.py b/clients/python/lakefs_sdk/api/staging_api.py index e82c4ec395c..e689bf6da03 100644 --- a/clients/python/lakefs_sdk/api/staging_api.py +++ b/clients/python/lakefs_sdk/api/staging_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr +try: + from pydantic.v1 import Field, StrictBool, StrictStr +except ImportError: + from pydantic import Field, StrictBool, StrictStr from typing import Optional diff --git a/clients/python/lakefs_sdk/api/tags_api.py b/clients/python/lakefs_sdk/api/tags_api.py index 34533bd68ad..a6d6150549a 100644 --- a/clients/python/lakefs_sdk/api/tags_api.py +++ b/clients/python/lakefs_sdk/api/tags_api.py @@ -17,10 +17,16 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint +try: + from pydantic.v1 import Field, StrictBool, StrictStr, conint +except ImportError: + from pydantic import Field, StrictBool, StrictStr, conint from typing import Optional diff --git a/clients/python/lakefs_sdk/api_response.py b/clients/python/lakefs_sdk/api_response.py index d81c2ff5847..66e5192ce98 100644 --- a/clients/python/lakefs_sdk/api_response.py +++ b/clients/python/lakefs_sdk/api_response.py @@ -2,7 +2,10 @@ from __future__ import annotations from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +try: + from pydantic.v1 import Field, StrictInt, StrictStr +except ImportError: + from pydantic import Field, StrictInt, StrictStr class ApiResponse: """ diff --git a/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py b/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py index d0ad8ae81ce..c138002a2c9 100644 --- a/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py +++ b/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class AbortPresignMultipartUpload(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/access_key_credentials.py b/clients/python/lakefs_sdk/models/access_key_credentials.py index cd80f8f2593..7d061b8777b 100644 --- a/clients/python/lakefs_sdk/models/access_key_credentials.py +++ b/clients/python/lakefs_sdk/models/access_key_credentials.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, constr +try: + from pydantic.v1 import BaseModel, Field, constr +except ImportError: + from pydantic import BaseModel, Field, constr class AccessKeyCredentials(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/acl.py b/clients/python/lakefs_sdk/models/acl.py index c3fa08ed9dd..0e66ed2d9da 100644 --- a/clients/python/lakefs_sdk/models/acl.py +++ b/clients/python/lakefs_sdk/models/acl.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class ACL(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/action_run.py b/clients/python/lakefs_sdk/models/action_run.py index 2c19a48d67f..b1255325ca6 100644 --- a/clients/python/lakefs_sdk/models/action_run.py +++ b/clients/python/lakefs_sdk/models/action_run.py @@ -20,7 +20,10 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictStr, validator class ActionRun(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/action_run_list.py b/clients/python/lakefs_sdk/models/action_run_list.py index fb516be8b2a..d354d499971 100644 --- a/clients/python/lakefs_sdk/models/action_run_list.py +++ b/clients/python/lakefs_sdk/models/action_run_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.action_run import ActionRun from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/auth_capabilities.py b/clients/python/lakefs_sdk/models/auth_capabilities.py index 2d6fe1abd63..c4ec58db820 100644 --- a/clients/python/lakefs_sdk/models/auth_capabilities.py +++ b/clients/python/lakefs_sdk/models/auth_capabilities.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, StrictBool +try: + from pydantic.v1 import BaseModel, StrictBool +except ImportError: + from pydantic import BaseModel, StrictBool class AuthCapabilities(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/authentication_token.py b/clients/python/lakefs_sdk/models/authentication_token.py index 5c0819207f8..0f51d64c700 100644 --- a/clients/python/lakefs_sdk/models/authentication_token.py +++ b/clients/python/lakefs_sdk/models/authentication_token.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class AuthenticationToken(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/branch_creation.py b/clients/python/lakefs_sdk/models/branch_creation.py index 25c308a6909..e9db41e4bea 100644 --- a/clients/python/lakefs_sdk/models/branch_creation.py +++ b/clients/python/lakefs_sdk/models/branch_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class BranchCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/branch_protection_rule.py b/clients/python/lakefs_sdk/models/branch_protection_rule.py index d06e1c9192f..0639d5d72ac 100644 --- a/clients/python/lakefs_sdk/models/branch_protection_rule.py +++ b/clients/python/lakefs_sdk/models/branch_protection_rule.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, constr +try: + from pydantic.v1 import BaseModel, Field, constr +except ImportError: + from pydantic import BaseModel, Field, constr class BranchProtectionRule(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/cherry_pick_creation.py b/clients/python/lakefs_sdk/models/cherry_pick_creation.py index 247ccdc7d66..a97e7311064 100644 --- a/clients/python/lakefs_sdk/models/cherry_pick_creation.py +++ b/clients/python/lakefs_sdk/models/cherry_pick_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class CherryPickCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/comm_prefs_input.py b/clients/python/lakefs_sdk/models/comm_prefs_input.py index 92fd34eeb2e..93c9c2cd0e1 100644 --- a/clients/python/lakefs_sdk/models/comm_prefs_input.py +++ b/clients/python/lakefs_sdk/models/comm_prefs_input.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class CommPrefsInput(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/commit.py b/clients/python/lakefs_sdk/models/commit.py index 7bc497e9b21..311b60510fe 100644 --- a/clients/python/lakefs_sdk/models/commit.py +++ b/clients/python/lakefs_sdk/models/commit.py @@ -20,7 +20,10 @@ from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conint, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conint, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr, conint, conlist class Commit(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/commit_creation.py b/clients/python/lakefs_sdk/models/commit_creation.py index 86eb9ca4314..a5ec2d926e1 100644 --- a/clients/python/lakefs_sdk/models/commit_creation.py +++ b/clients/python/lakefs_sdk/models/commit_creation.py @@ -20,7 +20,10 @@ from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class CommitCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/commit_list.py b/clients/python/lakefs_sdk/models/commit_list.py index 54a6f8bb80c..8effc0aedd2 100644 --- a/clients/python/lakefs_sdk/models/commit_list.py +++ b/clients/python/lakefs_sdk/models/commit_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.commit import Commit from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/commit_record_creation.py b/clients/python/lakefs_sdk/models/commit_record_creation.py index 7156e58e331..422bec48c76 100644 --- a/clients/python/lakefs_sdk/models/commit_record_creation.py +++ b/clients/python/lakefs_sdk/models/commit_record_creation.py @@ -20,7 +20,10 @@ from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist class CommitRecordCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py b/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py index 9bcc83dc5c7..ab356dc83e2 100644 --- a/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py +++ b/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py @@ -20,7 +20,10 @@ from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist from lakefs_sdk.models.upload_part import UploadPart class CompletePresignMultipartUpload(BaseModel): diff --git a/clients/python/lakefs_sdk/models/config.py b/clients/python/lakefs_sdk/models/config.py index 9c3a02446a9..46f91c0b1b5 100644 --- a/clients/python/lakefs_sdk/models/config.py +++ b/clients/python/lakefs_sdk/models/config.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel +try: + from pydantic.v1 import BaseModel +except ImportError: + from pydantic import BaseModel from lakefs_sdk.models.storage_config import StorageConfig from lakefs_sdk.models.version_config import VersionConfig diff --git a/clients/python/lakefs_sdk/models/credentials.py b/clients/python/lakefs_sdk/models/credentials.py index 0dae6f1953a..e49a5c735f2 100644 --- a/clients/python/lakefs_sdk/models/credentials.py +++ b/clients/python/lakefs_sdk/models/credentials.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class Credentials(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/credentials_list.py b/clients/python/lakefs_sdk/models/credentials_list.py index 121948262b9..9678d88df9d 100644 --- a/clients/python/lakefs_sdk/models/credentials_list.py +++ b/clients/python/lakefs_sdk/models/credentials_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.credentials import Credentials from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/credentials_with_secret.py b/clients/python/lakefs_sdk/models/credentials_with_secret.py index 6b633110653..d4ea483b984 100644 --- a/clients/python/lakefs_sdk/models/credentials_with_secret.py +++ b/clients/python/lakefs_sdk/models/credentials_with_secret.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class CredentialsWithSecret(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/current_user.py b/clients/python/lakefs_sdk/models/current_user.py index 1db27ed7186..0927cdc7e84 100644 --- a/clients/python/lakefs_sdk/models/current_user.py +++ b/clients/python/lakefs_sdk/models/current_user.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field +try: + from pydantic.v1 import BaseModel, Field +except ImportError: + from pydantic import BaseModel, Field from lakefs_sdk.models.user import User class CurrentUser(BaseModel): diff --git a/clients/python/lakefs_sdk/models/diff.py b/clients/python/lakefs_sdk/models/diff.py index 392fc574e27..88efee897e7 100644 --- a/clients/python/lakefs_sdk/models/diff.py +++ b/clients/python/lakefs_sdk/models/diff.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr, validator class Diff(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/diff_list.py b/clients/python/lakefs_sdk/models/diff_list.py index 9b63f5980d4..4068c89412b 100644 --- a/clients/python/lakefs_sdk/models/diff_list.py +++ b/clients/python/lakefs_sdk/models/diff_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.diff import Diff from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/error.py b/clients/python/lakefs_sdk/models/error.py index ad14c8e21f4..11d909de7e5 100644 --- a/clients/python/lakefs_sdk/models/error.py +++ b/clients/python/lakefs_sdk/models/error.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class Error(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/error_no_acl.py b/clients/python/lakefs_sdk/models/error_no_acl.py index b061bbd1989..2e9d8736d69 100644 --- a/clients/python/lakefs_sdk/models/error_no_acl.py +++ b/clients/python/lakefs_sdk/models/error_no_acl.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class ErrorNoACL(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/external_login_information.py b/clients/python/lakefs_sdk/models/external_login_information.py index 266b862dab0..9fa8c46c915 100644 --- a/clients/python/lakefs_sdk/models/external_login_information.py +++ b/clients/python/lakefs_sdk/models/external_login_information.py @@ -20,7 +20,10 @@ from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictInt +try: + from pydantic.v1 import BaseModel, Field, StrictInt +except ImportError: + from pydantic import BaseModel, Field, StrictInt class ExternalLoginInformation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/external_principal.py b/clients/python/lakefs_sdk/models/external_principal.py index ff4f5ada8c6..039e66caf41 100644 --- a/clients/python/lakefs_sdk/models/external_principal.py +++ b/clients/python/lakefs_sdk/models/external_principal.py @@ -20,7 +20,10 @@ from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist class ExternalPrincipal(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/external_principal_creation.py b/clients/python/lakefs_sdk/models/external_principal_creation.py index 9e7aef4133d..87d04d77ad2 100644 --- a/clients/python/lakefs_sdk/models/external_principal_creation.py +++ b/clients/python/lakefs_sdk/models/external_principal_creation.py @@ -20,7 +20,10 @@ from typing import Dict, List, Optional -from pydantic import BaseModel, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, StrictStr, conlist class ExternalPrincipalCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/external_principal_list.py b/clients/python/lakefs_sdk/models/external_principal_list.py index 79df3ef7500..39d3d46fb48 100644 --- a/clients/python/lakefs_sdk/models/external_principal_list.py +++ b/clients/python/lakefs_sdk/models/external_principal_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/find_merge_base_result.py b/clients/python/lakefs_sdk/models/find_merge_base_result.py index e55850b8257..d5bd5f5adf2 100644 --- a/clients/python/lakefs_sdk/models/find_merge_base_result.py +++ b/clients/python/lakefs_sdk/models/find_merge_base_result.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class FindMergeBaseResult(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/garbage_collection_config.py b/clients/python/lakefs_sdk/models/garbage_collection_config.py index e4ff4a100f5..6ec2bff526d 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_config.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_config.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt +try: + from pydantic.v1 import BaseModel, Field, StrictInt +except ImportError: + from pydantic import BaseModel, Field, StrictInt class GarbageCollectionConfig(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py b/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py index 3640b459ec4..51353e69fdf 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class GarbageCollectionPrepareResponse(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/garbage_collection_rule.py b/clients/python/lakefs_sdk/models/garbage_collection_rule.py index d0a24a49bfc..ad971b0dea7 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_rule.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_rule.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class GarbageCollectionRule(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/garbage_collection_rules.py b/clients/python/lakefs_sdk/models/garbage_collection_rules.py index 87e757a5a01..a8932ebcd9b 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_rules.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_rules.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, StrictInt, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictInt, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictInt, conlist from lakefs_sdk.models.garbage_collection_rule import GarbageCollectionRule class GarbageCollectionRules(BaseModel): diff --git a/clients/python/lakefs_sdk/models/group.py b/clients/python/lakefs_sdk/models/group.py index d657ac991dd..a9cbbfdc374 100644 --- a/clients/python/lakefs_sdk/models/group.py +++ b/clients/python/lakefs_sdk/models/group.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class Group(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/group_creation.py b/clients/python/lakefs_sdk/models/group_creation.py index 53f896a9db8..afd9533b94e 100644 --- a/clients/python/lakefs_sdk/models/group_creation.py +++ b/clients/python/lakefs_sdk/models/group_creation.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class GroupCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/group_list.py b/clients/python/lakefs_sdk/models/group_list.py index ea9f7e22edc..a558d20e47d 100644 --- a/clients/python/lakefs_sdk/models/group_list.py +++ b/clients/python/lakefs_sdk/models/group_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.group import Group from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/hook_run.py b/clients/python/lakefs_sdk/models/hook_run.py index eb4c5abd190..861ddf9d4eb 100644 --- a/clients/python/lakefs_sdk/models/hook_run.py +++ b/clients/python/lakefs_sdk/models/hook_run.py @@ -20,7 +20,10 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictStr, validator class HookRun(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/hook_run_list.py b/clients/python/lakefs_sdk/models/hook_run_list.py index 0d20acd1015..9fa8148ad65 100644 --- a/clients/python/lakefs_sdk/models/hook_run_list.py +++ b/clients/python/lakefs_sdk/models/hook_run_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.hook_run import HookRun from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/import_creation.py b/clients/python/lakefs_sdk/models/import_creation.py index eb654a3bba4..1faa8f97f64 100644 --- a/clients/python/lakefs_sdk/models/import_creation.py +++ b/clients/python/lakefs_sdk/models/import_creation.py @@ -20,7 +20,10 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictBool, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictBool, conlist from lakefs_sdk.models.commit_creation import CommitCreation from lakefs_sdk.models.import_location import ImportLocation diff --git a/clients/python/lakefs_sdk/models/import_creation_response.py b/clients/python/lakefs_sdk/models/import_creation_response.py index 1b23ead38a0..1b7d179e5cf 100644 --- a/clients/python/lakefs_sdk/models/import_creation_response.py +++ b/clients/python/lakefs_sdk/models/import_creation_response.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class ImportCreationResponse(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/import_location.py b/clients/python/lakefs_sdk/models/import_location.py index 94ac2d24d95..0711b07faf8 100644 --- a/clients/python/lakefs_sdk/models/import_location.py +++ b/clients/python/lakefs_sdk/models/import_location.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictStr, validator class ImportLocation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/import_status.py b/clients/python/lakefs_sdk/models/import_status.py index 0251d560c9d..fc97e10a546 100644 --- a/clients/python/lakefs_sdk/models/import_status.py +++ b/clients/python/lakefs_sdk/models/import_status.py @@ -20,7 +20,10 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr from lakefs_sdk.models.commit import Commit from lakefs_sdk.models.error import Error diff --git a/clients/python/lakefs_sdk/models/installation_usage_report.py b/clients/python/lakefs_sdk/models/installation_usage_report.py index 67349c6cd83..bcf1f26fcbc 100644 --- a/clients/python/lakefs_sdk/models/installation_usage_report.py +++ b/clients/python/lakefs_sdk/models/installation_usage_report.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist from lakefs_sdk.models.usage_report import UsageReport class InstallationUsageReport(BaseModel): diff --git a/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py b/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py index 63e855a3594..eab749e1f31 100644 --- a/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py +++ b/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class InternalDeleteBranchProtectionRuleRequest(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/login_config.py b/clients/python/lakefs_sdk/models/login_config.py index f828c5cc423..3509420a6ce 100644 --- a/clients/python/lakefs_sdk/models/login_config.py +++ b/clients/python/lakefs_sdk/models/login_config.py @@ -20,7 +20,10 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, validator +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist, validator +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist, validator class LoginConfig(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/login_information.py b/clients/python/lakefs_sdk/models/login_information.py index 0d9be9add54..1a4e2fb177b 100644 --- a/clients/python/lakefs_sdk/models/login_information.py +++ b/clients/python/lakefs_sdk/models/login_information.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class LoginInformation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/merge.py b/clients/python/lakefs_sdk/models/merge.py index a2bcf6b3284..95d1984fc30 100644 --- a/clients/python/lakefs_sdk/models/merge.py +++ b/clients/python/lakefs_sdk/models/merge.py @@ -20,7 +20,10 @@ from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class Merge(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/merge_result.py b/clients/python/lakefs_sdk/models/merge_result.py index 10e041eedc4..8abf6d571b1 100644 --- a/clients/python/lakefs_sdk/models/merge_result.py +++ b/clients/python/lakefs_sdk/models/merge_result.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class MergeResult(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/meta_range_creation.py b/clients/python/lakefs_sdk/models/meta_range_creation.py index 609c3fb71a6..1543402789c 100644 --- a/clients/python/lakefs_sdk/models/meta_range_creation.py +++ b/clients/python/lakefs_sdk/models/meta_range_creation.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.range_metadata import RangeMetadata class MetaRangeCreation(BaseModel): diff --git a/clients/python/lakefs_sdk/models/meta_range_creation_response.py b/clients/python/lakefs_sdk/models/meta_range_creation_response.py index aae854710f7..621cd0f9906 100644 --- a/clients/python/lakefs_sdk/models/meta_range_creation_response.py +++ b/clients/python/lakefs_sdk/models/meta_range_creation_response.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class MetaRangeCreationResponse(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/object_copy_creation.py b/clients/python/lakefs_sdk/models/object_copy_creation.py index 65accf71806..d7a80aac5e9 100644 --- a/clients/python/lakefs_sdk/models/object_copy_creation.py +++ b/clients/python/lakefs_sdk/models/object_copy_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class ObjectCopyCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/object_error.py b/clients/python/lakefs_sdk/models/object_error.py index df546f64633..14977fcaad4 100644 --- a/clients/python/lakefs_sdk/models/object_error.py +++ b/clients/python/lakefs_sdk/models/object_error.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class ObjectError(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/object_error_list.py b/clients/python/lakefs_sdk/models/object_error_list.py index 32d6f7570b1..1f57c0d29cf 100644 --- a/clients/python/lakefs_sdk/models/object_error_list.py +++ b/clients/python/lakefs_sdk/models/object_error_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.object_error import ObjectError class ObjectErrorList(BaseModel): diff --git a/clients/python/lakefs_sdk/models/object_stage_creation.py b/clients/python/lakefs_sdk/models/object_stage_creation.py index 2273fe98be8..31831f9d4e4 100644 --- a/clients/python/lakefs_sdk/models/object_stage_creation.py +++ b/clients/python/lakefs_sdk/models/object_stage_creation.py @@ -20,7 +20,10 @@ from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class ObjectStageCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/object_stats.py b/clients/python/lakefs_sdk/models/object_stats.py index 95d10a77409..4ea3204bdbe 100644 --- a/clients/python/lakefs_sdk/models/object_stats.py +++ b/clients/python/lakefs_sdk/models/object_stats.py @@ -20,7 +20,10 @@ from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr, validator class ObjectStats(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/object_stats_list.py b/clients/python/lakefs_sdk/models/object_stats_list.py index 3da5c3cb988..17651b46e26 100644 --- a/clients/python/lakefs_sdk/models/object_stats_list.py +++ b/clients/python/lakefs_sdk/models/object_stats_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.models.pagination import Pagination diff --git a/clients/python/lakefs_sdk/models/pagination.py b/clients/python/lakefs_sdk/models/pagination.py index 8c9a79dedb4..e6ef36a620e 100644 --- a/clients/python/lakefs_sdk/models/pagination.py +++ b/clients/python/lakefs_sdk/models/pagination.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictBool, StrictStr, conint +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conint +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr, conint class Pagination(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/path_list.py b/clients/python/lakefs_sdk/models/path_list.py index c3a4f3bd92e..3a21c16c371 100644 --- a/clients/python/lakefs_sdk/models/path_list.py +++ b/clients/python/lakefs_sdk/models/path_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist class PathList(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/policy.py b/clients/python/lakefs_sdk/models/policy.py index 43862d93bde..656c3469abb 100644 --- a/clients/python/lakefs_sdk/models/policy.py +++ b/clients/python/lakefs_sdk/models/policy.py @@ -20,7 +20,10 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist from lakefs_sdk.models.statement import Statement class Policy(BaseModel): diff --git a/clients/python/lakefs_sdk/models/policy_list.py b/clients/python/lakefs_sdk/models/policy_list.py index 7bf060a3196..a94190afd38 100644 --- a/clients/python/lakefs_sdk/models/policy_list.py +++ b/clients/python/lakefs_sdk/models/policy_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.policy import Policy diff --git a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py index e6e893c158b..24224c2922e 100644 --- a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py +++ b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, StrictStr +try: + from pydantic.v1 import BaseModel, StrictStr +except ImportError: + from pydantic import BaseModel, StrictStr class PrepareGCUncommittedRequest(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py index 61fd802235d..8a64efb727d 100644 --- a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py +++ b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class PrepareGCUncommittedResponse(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/presign_multipart_upload.py b/clients/python/lakefs_sdk/models/presign_multipart_upload.py index a8f6e19bdb8..7685cbc65b2 100644 --- a/clients/python/lakefs_sdk/models/presign_multipart_upload.py +++ b/clients/python/lakefs_sdk/models/presign_multipart_upload.py @@ -20,7 +20,10 @@ from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist class PresignMultipartUpload(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/range_metadata.py b/clients/python/lakefs_sdk/models/range_metadata.py index a2f5c3dfc90..b95f2007052 100644 --- a/clients/python/lakefs_sdk/models/range_metadata.py +++ b/clients/python/lakefs_sdk/models/range_metadata.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class RangeMetadata(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/ref.py b/clients/python/lakefs_sdk/models/ref.py index ad18f85ce13..1449ae43a47 100644 --- a/clients/python/lakefs_sdk/models/ref.py +++ b/clients/python/lakefs_sdk/models/ref.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class Ref(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/ref_list.py b/clients/python/lakefs_sdk/models/ref_list.py index 1d3d725df42..6282a6a185f 100644 --- a/clients/python/lakefs_sdk/models/ref_list.py +++ b/clients/python/lakefs_sdk/models/ref_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.ref import Ref diff --git a/clients/python/lakefs_sdk/models/refs_dump.py b/clients/python/lakefs_sdk/models/refs_dump.py index 36271850de0..63c080601f0 100644 --- a/clients/python/lakefs_sdk/models/refs_dump.py +++ b/clients/python/lakefs_sdk/models/refs_dump.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class RefsDump(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/refs_restore.py b/clients/python/lakefs_sdk/models/refs_restore.py index 13d72fb2132..9efb78369e3 100644 --- a/clients/python/lakefs_sdk/models/refs_restore.py +++ b/clients/python/lakefs_sdk/models/refs_restore.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class RefsRestore(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/repository.py b/clients/python/lakefs_sdk/models/repository.py index 8216eb8fd01..44bfd179541 100644 --- a/clients/python/lakefs_sdk/models/repository.py +++ b/clients/python/lakefs_sdk/models/repository.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class Repository(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/repository_creation.py b/clients/python/lakefs_sdk/models/repository_creation.py index d6b9ffa0c97..c53ace2d59b 100644 --- a/clients/python/lakefs_sdk/models/repository_creation.py +++ b/clients/python/lakefs_sdk/models/repository_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, constr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr, constr, validator class RepositoryCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/repository_dump_status.py b/clients/python/lakefs_sdk/models/repository_dump_status.py index b41aab2cdc3..6a3fb26a5a0 100644 --- a/clients/python/lakefs_sdk/models/repository_dump_status.py +++ b/clients/python/lakefs_sdk/models/repository_dump_status.py @@ -20,7 +20,10 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr from lakefs_sdk.models.refs_dump import RefsDump class RepositoryDumpStatus(BaseModel): diff --git a/clients/python/lakefs_sdk/models/repository_list.py b/clients/python/lakefs_sdk/models/repository_list.py index a89f759a716..5a0e3d10a8d 100644 --- a/clients/python/lakefs_sdk/models/repository_list.py +++ b/clients/python/lakefs_sdk/models/repository_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.repository import Repository diff --git a/clients/python/lakefs_sdk/models/repository_metadata_keys.py b/clients/python/lakefs_sdk/models/repository_metadata_keys.py index 4a2448589ee..50b6b67841e 100644 --- a/clients/python/lakefs_sdk/models/repository_metadata_keys.py +++ b/clients/python/lakefs_sdk/models/repository_metadata_keys.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist class RepositoryMetadataKeys(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/repository_metadata_set.py b/clients/python/lakefs_sdk/models/repository_metadata_set.py index 3d5fd53d1e5..0d40846d095 100644 --- a/clients/python/lakefs_sdk/models/repository_metadata_set.py +++ b/clients/python/lakefs_sdk/models/repository_metadata_set.py @@ -20,7 +20,10 @@ from typing import Dict -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class RepositoryMetadataSet(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/repository_restore_status.py b/clients/python/lakefs_sdk/models/repository_restore_status.py index 34955368786..fc9a9708b94 100644 --- a/clients/python/lakefs_sdk/models/repository_restore_status.py +++ b/clients/python/lakefs_sdk/models/repository_restore_status.py @@ -20,7 +20,10 @@ from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class RepositoryRestoreStatus(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/reset_creation.py b/clients/python/lakefs_sdk/models/reset_creation.py index 4499aa80560..b29a650355f 100644 --- a/clients/python/lakefs_sdk/models/reset_creation.py +++ b/clients/python/lakefs_sdk/models/reset_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr, validator class ResetCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/revert_creation.py b/clients/python/lakefs_sdk/models/revert_creation.py index 4f8e4c16f07..a9da6f57908 100644 --- a/clients/python/lakefs_sdk/models/revert_creation.py +++ b/clients/python/lakefs_sdk/models/revert_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr class RevertCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/setup.py b/clients/python/lakefs_sdk/models/setup.py index 44b16e10a6f..3cd1abebf7d 100644 --- a/clients/python/lakefs_sdk/models/setup.py +++ b/clients/python/lakefs_sdk/models/setup.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr from lakefs_sdk.models.access_key_credentials import AccessKeyCredentials class Setup(BaseModel): diff --git a/clients/python/lakefs_sdk/models/setup_state.py b/clients/python/lakefs_sdk/models/setup_state.py index f33aa767d95..6d6c617c240 100644 --- a/clients/python/lakefs_sdk/models/setup_state.py +++ b/clients/python/lakefs_sdk/models/setup_state.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr, validator from lakefs_sdk.models.login_config import LoginConfig class SetupState(BaseModel): diff --git a/clients/python/lakefs_sdk/models/staging_location.py b/clients/python/lakefs_sdk/models/staging_location.py index d5a111df0dd..e016c3f540c 100644 --- a/clients/python/lakefs_sdk/models/staging_location.py +++ b/clients/python/lakefs_sdk/models/staging_location.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class StagingLocation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/staging_metadata.py b/clients/python/lakefs_sdk/models/staging_metadata.py index 6ae206d9d14..26a0fe1f3d9 100644 --- a/clients/python/lakefs_sdk/models/staging_metadata.py +++ b/clients/python/lakefs_sdk/models/staging_metadata.py @@ -20,7 +20,10 @@ from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr from lakefs_sdk.models.staging_location import StagingLocation class StagingMetadata(BaseModel): diff --git a/clients/python/lakefs_sdk/models/statement.py b/clients/python/lakefs_sdk/models/statement.py index bcb8085b61a..a87fa305401 100644 --- a/clients/python/lakefs_sdk/models/statement.py +++ b/clients/python/lakefs_sdk/models/statement.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist, validator +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist, validator +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist, validator class Statement(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/stats_event.py b/clients/python/lakefs_sdk/models/stats_event.py index 957cd8a426f..ef504d1401f 100644 --- a/clients/python/lakefs_sdk/models/stats_event.py +++ b/clients/python/lakefs_sdk/models/stats_event.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class StatsEvent(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/stats_events_list.py b/clients/python/lakefs_sdk/models/stats_events_list.py index 4c18cc634b7..c9b30c3a1fe 100644 --- a/clients/python/lakefs_sdk/models/stats_events_list.py +++ b/clients/python/lakefs_sdk/models/stats_events_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.stats_event import StatsEvent class StatsEventsList(BaseModel): diff --git a/clients/python/lakefs_sdk/models/storage_config.py b/clients/python/lakefs_sdk/models/storage_config.py index 8e4254c796d..eddeab29b3e 100644 --- a/clients/python/lakefs_sdk/models/storage_config.py +++ b/clients/python/lakefs_sdk/models/storage_config.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class StorageConfig(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/storage_uri.py b/clients/python/lakefs_sdk/models/storage_uri.py index 6c7e525abe4..96ba09be50b 100644 --- a/clients/python/lakefs_sdk/models/storage_uri.py +++ b/clients/python/lakefs_sdk/models/storage_uri.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class StorageURI(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/sts_auth_request.py b/clients/python/lakefs_sdk/models/sts_auth_request.py index 7ae48616940..3fe5e242488 100644 --- a/clients/python/lakefs_sdk/models/sts_auth_request.py +++ b/clients/python/lakefs_sdk/models/sts_auth_request.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class StsAuthRequest(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/tag_creation.py b/clients/python/lakefs_sdk/models/tag_creation.py index f675103333c..394a54c944c 100644 --- a/clients/python/lakefs_sdk/models/tag_creation.py +++ b/clients/python/lakefs_sdk/models/tag_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class TagCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/task_info.py b/clients/python/lakefs_sdk/models/task_info.py index addb7ffa7e2..caeda8dd206 100644 --- a/clients/python/lakefs_sdk/models/task_info.py +++ b/clients/python/lakefs_sdk/models/task_info.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class TaskInfo(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/underlying_object_properties.py b/clients/python/lakefs_sdk/models/underlying_object_properties.py index fa3f59b7ce9..d93d6831c62 100644 --- a/clients/python/lakefs_sdk/models/underlying_object_properties.py +++ b/clients/python/lakefs_sdk/models/underlying_object_properties.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, StrictStr +try: + from pydantic.v1 import BaseModel, StrictStr +except ImportError: + from pydantic import BaseModel, StrictStr class UnderlyingObjectProperties(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/update_token.py b/clients/python/lakefs_sdk/models/update_token.py index 11010283432..8f6f223e38c 100644 --- a/clients/python/lakefs_sdk/models/update_token.py +++ b/clients/python/lakefs_sdk/models/update_token.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr class UpdateToken(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/upload_part.py b/clients/python/lakefs_sdk/models/upload_part.py index 858be66621e..31d3a2e42b2 100644 --- a/clients/python/lakefs_sdk/models/upload_part.py +++ b/clients/python/lakefs_sdk/models/upload_part.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class UploadPart(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/usage_report.py b/clients/python/lakefs_sdk/models/usage_report.py index bfd5bd2289a..158ee86da7b 100644 --- a/clients/python/lakefs_sdk/models/usage_report.py +++ b/clients/python/lakefs_sdk/models/usage_report.py @@ -20,7 +20,10 @@ -from pydantic import BaseModel, Field, StrictInt +try: + from pydantic.v1 import BaseModel, Field, StrictInt +except ImportError: + from pydantic import BaseModel, Field, StrictInt class UsageReport(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/user.py b/clients/python/lakefs_sdk/models/user.py index c47cd01f2e4..5b8a635a3fe 100644 --- a/clients/python/lakefs_sdk/models/user.py +++ b/clients/python/lakefs_sdk/models/user.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr class User(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/user_creation.py b/clients/python/lakefs_sdk/models/user_creation.py index 461f972ee77..9613e3a2311 100644 --- a/clients/python/lakefs_sdk/models/user_creation.py +++ b/clients/python/lakefs_sdk/models/user_creation.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictBool, StrictStr class UserCreation(BaseModel): """ diff --git a/clients/python/lakefs_sdk/models/user_list.py b/clients/python/lakefs_sdk/models/user_list.py index c734b60213d..587ce74150b 100644 --- a/clients/python/lakefs_sdk/models/user_list.py +++ b/clients/python/lakefs_sdk/models/user_list.py @@ -20,7 +20,10 @@ from typing import List -from pydantic import BaseModel, Field, conlist +try: + from pydantic.v1 import BaseModel, Field, conlist +except ImportError: + from pydantic import BaseModel, Field, conlist from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.user import User diff --git a/clients/python/lakefs_sdk/models/version_config.py b/clients/python/lakefs_sdk/models/version_config.py index 8214c22d790..9b36e5dc8de 100644 --- a/clients/python/lakefs_sdk/models/version_config.py +++ b/clients/python/lakefs_sdk/models/version_config.py @@ -20,7 +20,10 @@ from typing import Optional -from pydantic import BaseModel, StrictBool, StrictStr +try: + from pydantic.v1 import BaseModel, StrictBool, StrictStr +except ImportError: + from pydantic import BaseModel, StrictBool, StrictStr class VersionConfig(BaseModel): """ diff --git a/clients/python/python-codegen-config.yaml b/clients/python/python-codegen-config.yaml index 0064ea1f86b..de28dd1c80f 100644 --- a/clients/python/python-codegen-config.yaml +++ b/clients/python/python-codegen-config.yaml @@ -3,3 +3,7 @@ files: templateType: SupportingFiles folder: lakefs_sdk destinationFilename: client.py + + requirements.mustache: + templateType: SupportingFiles + destinationFilename: requirements.txt \ No newline at end of file diff --git a/clients/python/requirements.txt b/clients/python/requirements.txt index 258c179c10b..267ad939495 100644 --- a/clients/python/requirements.txt +++ b/clients/python/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3, < 2.1.0 -pydantic >= 1.10.5, < 2 -aenum >= 3.1.11 +pydantic >= 1.10.5 +aenum >= 3.1.11 \ No newline at end of file diff --git a/clients/python/scripts/pydantic.sh b/clients/python/scripts/pydantic.sh new file mode 100755 index 00000000000..c35d1bbfc35 --- /dev/null +++ b/clients/python/scripts/pydantic.sh @@ -0,0 +1,20 @@ +#!/bin/bash -eu + +set -o pipefail + +filename=$1 + +while IFS= read -r line; do + if [ -z "${line}" ]; then + echo "Nothing to do" + continue + fi + echo $line + modules=$(echo $line | awk -F 'from pydantic import ' '{print $2}') + newline="try:\n from pydantic.v1 import $modules\nexcept ImportError:\n from pydantic import $modules" + + echo "$newline" + + echo "Replacing import statement" + sed -i "s/$line/$newline/g" "$filename" +done <<< "$(sed -n '/^from pydantic import/p' $filename)" diff --git a/clients/python/setup.py b/clients/python/setup.py index 5ea3b74a959..ca6c8f9a8f6 100644 --- a/clients/python/setup.py +++ b/clients/python/setup.py @@ -26,7 +26,7 @@ REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", "python-dateutil", - "pydantic >= 1.10.5, < 2", + "pydantic >= 1.10.5", "aenum" ] diff --git a/clients/python/templates/requirements.mustache b/clients/python/templates/requirements.mustache new file mode 100644 index 00000000000..267ad939495 --- /dev/null +++ b/clients/python/templates/requirements.mustache @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 1.10.5 +aenum >= 3.1.11 \ No newline at end of file diff --git a/clients/python/templates/setup.mustache b/clients/python/templates/setup.mustache index 14b23b1706e..c277f5fdc6f 100644 --- a/clients/python/templates/setup.mustache +++ b/clients/python/templates/setup.mustache @@ -18,7 +18,7 @@ PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", "python-dateutil", - "pydantic >= 1.10.5, < 2", + "pydantic >= 1.10.5", "aenum" ]