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

DATA-3183: upgrade pydantic 2 #12

Merged
merged 8 commits into from
Nov 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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down
7 changes: 4 additions & 3 deletions data_diff/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ def dbt_diff(

futures = {}

with log_status_handler.status if log_status_handler else nullcontext(), ThreadPoolExecutor(
max_workers=dbt_parser.threads
) as executor:
with (
log_status_handler.status if log_status_handler else nullcontext(),
ThreadPoolExecutor(max_workers=dbt_parser.threads) as executor,
):
for model in models:
if log_status_handler:
log_status_handler.set_prefix(f"Diffing {model.alias} \n")
Expand Down
10 changes: 5 additions & 5 deletions data_diff/dbt_config_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

class ManifestJsonConfig(BaseModel):
class Metadata(BaseModel):
dbt_version: str = Field(..., regex=r"^\d+\.\d+\.\d+([a-zA-Z0-9]+)?$")
project_id: Optional[str]
user_id: Optional[str]
dbt_version: str = Field(..., pattern=r"^\d+\.\d+\.\d+([a-zA-Z0-9]+)?$")
project_id: Optional[str] = None
user_id: Optional[str] = None

class Nodes(BaseModel):
class Config(BaseModel):
Expand Down Expand Up @@ -37,7 +37,7 @@ class DependsOn(BaseModel):
meta: Dict[str, Any]
config: Config
tags: List[str]
test_metadata: Optional[TestMetadata]
test_metadata: Optional[TestMetadata] = None
depends_on: DependsOn

metadata: Metadata
Expand All @@ -46,7 +46,7 @@ class DependsOn(BaseModel):

class RunResultsJsonConfig(BaseModel):
class Metadata(BaseModel):
dbt_version: str = Field(..., regex=r"^\d+\.\d+\.\d+([a-zA-Z0-9]+)?$")
dbt_version: str = Field(..., pattern=r"^\d+\.\d+\.\d+([a-zA-Z0-9]+)?$")

class Results(BaseModel):
class Status(Enum):
Expand Down
Loading
Loading