Skip to content

Commit

Permalink
Merge pull request #12 from coinlist/updated-pydantic
Browse files Browse the repository at this point in the history
upgrade pydantic 2

The prefect worker now uses 3.0 version and i am tying that to latest versions of pydantic rather than keep it with a downgraded version that will not be supported. This goes into pipo.
  • Loading branch information
ondramie authored Nov 22, 2024
2 parents 1641ef5 + c2d85de commit 704bae4
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 165 deletions.
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

0 comments on commit 704bae4

Please sign in to comment.