Skip to content

Commit

Permalink
Add invocation_started_at
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Feb 10, 2025
1 parent 7f32e42 commit b4b2e42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Breaking Changes-20250210-123306.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Breaking Changes
body: Add invocations_started_at field to artifact metadata
time: 2025-02-10T12:33:06.722803-05:00
custom:
Author: gshank
Issue: "11272"
3 changes: 2 additions & 1 deletion core/dbt/artifacts/schemas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from dbt_common.dataclass_schema import dbtClassMixin
from dbt_common.events.functions import get_metadata_vars
from dbt_common.exceptions import DbtInternalError, DbtRuntimeError
from dbt_common.invocation import get_invocation_id
from dbt_common.invocation import get_invocation_id, get_invocation_started_at

BASE_SCHEMAS_URL = "https://schemas.getdbt.com/"
SCHEMA_PATH = "dbt/{name}/v{version}.json"
Expand Down Expand Up @@ -57,6 +57,7 @@ class BaseArtifactMetadata(dbtClassMixin):
dbt_version: str = __version__
generated_at: datetime = dataclasses.field(default_factory=datetime.utcnow)
invocation_id: Optional[str] = dataclasses.field(default_factory=get_invocation_id)
invocation_started_at: datetime = dataclasses.field(default_factory=get_invocation_started_at)
env: Dict[str, str] = dataclasses.field(default_factory=get_metadata_vars)

def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None):
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-adapters
git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-tests-adapter
git+https://github.com/dbt-labs/dbt-common.git@main
git+https://github.com/dbt-labs/dbt-common.git@invocation_started_at
git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-postgres
# black must match what's in .pre-commit-config.yaml to be sure local env matches CI
black==24.3.0
Expand Down

0 comments on commit b4b2e42

Please sign in to comment.