Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade pydantic version (v2+) #9

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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