Skip to content
Open
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 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read(*names, **kwargs):

setup(
name="altimate-datapilot-cli",
version="0.3.1",
version="0.3.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Version bump is incomplete — docs/conf.py and .bumpversion.cfg still report 0.3.1.

.bumpversion.cfg coordinates the version across three files (setup.py, docs/conf.py, src/datapilot/__init__.py). This PR updated setup.py and __init__.py to 0.3.2 but left docs/conf.py at version = release = "0.3.1" and .bumpversion.cfg at current_version = 0.3.1.

Consequences:

  • Sphinx docs will publish showing 0.3.1 while the package ships 0.3.2.
  • The next bumpversion run will fail: its search = version="{current_version}" pattern (0.3.1) no longer matches setup.py (now 0.3.2), raising VersionNotFoundError.

Use bumpversion patch (which updates all three files plus current_version and commits/tags), or bump all three files together so the version stays coordinated.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

license="MIT",
description="Assistant for Data Teams",
long_description="{}\n{}".format(
Expand Down
2 changes: 1 addition & 1 deletion src/datapilot/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.1"
__version__ = "0.3.2"
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,23 @@ class Metadata(BaseParserModel):
env: Optional[dict[str, str]] = None


class Status(Enum):
class Status(str, Enum):
success = "success"
error = "error"
skipped = "skipped"
partial_success = "partial success"
reused = "reused"

@classmethod
def _missing_(cls, value):
# Forward-compatibility: dbt periodically introduces new run statuses
# (e.g. "reused" in dbt 2.0). Surface unknown values as real members so
# downstream `.value` access keeps working instead of failing validation
# and silently dropping the entire run_results.json.
member = str.__new__(cls, value)
member._name_ = str(value)
member._value_ = value
return member


class Status1(Enum):
Expand Down Expand Up @@ -74,7 +86,7 @@ class Result(BaseParserModel):
model_config = ConfigDict(
extra="allow",
)
status: Union[Status, Status1, Status2]
status: Union[Status1, Status2, Status]
timing: list[TimingItem]
thread_id: str
execution_time: float
Expand Down
76 changes: 76 additions & 0 deletions tests/test_vendor/test_run_results_v6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""Tests for run_results v6 parser, specifically the resilient run `Status` enum.

Regression coverage for dbt 2.0 emitting ``status="reused"`` (and future unknown
statuses), which previously raised a ``ValidationError`` and caused the entire
run_results.json to be silently dropped during ingestion.
"""
from vendor.dbt_artifacts_parser.parser import parse_run_results
from vendor.dbt_artifacts_parser.parsers.run_results.run_results_v6 import Result, Status

V6_SCHEMA = "https://schemas.getdbt.com/dbt/run-results/v6.json"


def _result(status: str, unique_id: str) -> dict:
return {
"status": status,
"timing": [],
"thread_id": "Thread-1",
"execution_time": 0.1,
"adapter_response": {},
"unique_id": unique_id,
}


def _run_results(*statuses: str) -> dict:
return {
"metadata": {
"dbt_schema_version": V6_SCHEMA,
"dbt_version": "2.0.0",
"invocation_id": "test-invocation-123",
},
"elapsed_time": 1.5,
"args": {},
"results": [_result(s, f"model.proj.m{i}") for i, s in enumerate(statuses)],
}


class TestRunResultStatus:
"""The run `Status` enum must accept new/unknown dbt statuses without failing."""

def test_reused_status_parses(self):
"""dbt 2.0 emits `reused` for unchanged models; it must not fail validation."""
result = Result(**_result("reused", "model.proj.a"))
assert result.status.value == "reused"
assert result.status is Status.reused

def test_known_statuses_preserve_value(self):
"""Known run statuses still resolve with the correct `.value`."""
for status in ("success", "error", "skipped", "partial success"):
assert Result(**_result(status, "model.proj.a")).status.value == status

def test_unknown_future_status_parses(self):
"""Forward-compat: a status dbt has not shipped yet still parses via `_missing_`."""
result = Result(**_result("some_future_status", "model.proj.a"))
assert result.status.value == "some_future_status"

def test_test_and_freshness_statuses_keep_their_value(self):
"""Test/freshness statuses must keep their `.value` (resolved via Status1/Status2)."""
for status in ("pass", "fail", "warn", "runtime error"):
assert Result(**_result(status, "test.proj.t")).status.value == status


class TestParseRunResultsEntryPoint:
"""The public `parse_run_results` must parse a full file containing `reused`."""

def test_file_with_reused_result_parses_fully(self):
run_results = parse_run_results(_run_results("success", "reused", "skipped", "pass", "error", "no-op"))
# Previously this whole file was dropped because of the single `reused` row.
assert len(run_results.results) == 6
assert {r.status.value for r in run_results.results} == {
"success",
"reused",
"skipped",
"pass",
"error",
"no-op",
}
Loading