Skip to content

Commit

Permalink
Loosen Type in TimingInfo (#10897)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterallenwebb authored Oct 21, 2024
1 parent 7920b0e commit 3d96b4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
8 changes: 3 additions & 5 deletions core/dbt/artifacts/schemas/results.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Union
from typing import Any, Callable, Dict, List, Optional, Sequence, Union

from dbt.contracts.graph.nodes import ResultNode
from dbt_common.dataclass_schema import StrEnum, dbtClassMixin
Expand All @@ -16,7 +16,7 @@ class TimingInfo(dbtClassMixin):
Do not call directly, use `collect_timing_info` instead.
"""

name: Literal["compile", "execute", "other"]
name: str
started_at: Optional[datetime] = None
completed_at: Optional[datetime] = None

Expand All @@ -37,9 +37,7 @@ def to_msg_dict(self):

# This is a context manager
class collect_timing_info:
def __init__(
self, name: Literal["compile", "execute", "other"], callback: Callable[[TimingInfo], None]
) -> None:
def __init__(self, name: str, callback: Callable[[TimingInfo], None]) -> None:
self.timing_info = TimingInfo(name=name)
self.callback = callback

Expand Down
6 changes: 1 addition & 5 deletions schemas/dbt/run-results/v6.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@
"title": "TimingInfo",
"properties": {
"name": {
"enum": [
"compile",
"execute",
"other"
]
"type": "string"
},
"started_at": {
"anyOf": [
Expand Down
6 changes: 1 addition & 5 deletions schemas/dbt/sources/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,7 @@
"title": "TimingInfo",
"properties": {
"name": {
"enum": [
"compile",
"execute",
"other"
]
"type": "string"
},
"started_at": {
"anyOf": [
Expand Down

0 comments on commit 3d96b4e

Please sign in to comment.