Skip to content

Commit

Permalink
Merge pull request #9 from Toloka/feature/update_pydantic
Browse files Browse the repository at this point in the history
upgrade pydantic version (v2+)
  • Loading branch information
NikitaYurasov committed Apr 22, 2024
2 parents c0f69bf + fafd0f8 commit 8193b9a
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 400 deletions.
2 changes: 1 addition & 1 deletion dbt_af/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
'conf',
]

__version__ = '0.4.1'
__version__ = '0.4.2'

from . import conf, dags # noqa
6 changes: 5 additions & 1 deletion dbt_af/operators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from tempfile import TemporaryDirectory
from typing import Dict, Optional

import pydantic
try:
import pydantic.v1 as pydantic
except ModuleNotFoundError:
import pydantic

from airflow.operators.bash import BashOperator
from airflow.utils.context import Context

Expand Down
6 changes: 5 additions & 1 deletion dbt_af/parser/dbt_node_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
from typing import Any, DefaultDict, Dict, List, Optional, Union

import pendulum
import pydantic

try:
import pydantic.v1 as pydantic
except ModuleNotFoundError:
import pydantic

from dbt_af.common.constants import DOMAIN_DAG_START_DATE_FMT
from dbt_af.common.scheduling import BaseScheduleTag, ScheduleTag
Expand Down
5 changes: 4 additions & 1 deletion dbt_af/parser/dbt_profiles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from typing import Any, Literal

from pydantic import BaseModel, Field, root_validator
try:
from pydantic.v1 import BaseModel, Field, root_validator
except ModuleNotFoundError:
from pydantic import BaseModel, Field, root_validator

KUBERNETES_TARGET_TYPE = 'kubernetes'

Expand Down
5 changes: 4 additions & 1 deletion dbt_af/parser/dbt_source_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import os
from typing import Any, Dict, List, Optional

import pydantic
try:
import pydantic.v1 as pydantic
except ModuleNotFoundError:
import pydantic


class _FreshnessAfterModel(pydantic.BaseModel):
Expand Down
870 changes: 477 additions & 393 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dbt-af"
version = "0.4.1"
version = "0.4.2"
description = "Distibuted dbt runs on Apache Airflow"
authors = [
"Nikita Yurasov <nikitayurasov@toloka.ai>",
Expand All @@ -24,7 +24,7 @@ packages = [
python = ">=3.10,<4.0"
attrs = "~23.1"
apache-airflow = ">=2.6,<2.8.0"
pydantic = "~1.10.7"
pydantic = ">=1.10,<3.0.0"
apache-airflow-providers-cncf-kubernetes = ">=7.0.0"
cachetools = "~5.3"
typer = "~0.9"
Expand Down

0 comments on commit 8193b9a

Please sign in to comment.