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

Loosen Type in TimingInfo #10897

Merged
merged 3 commits into from
Oct 21, 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
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
Loading