Skip to content

Commit

Permalink
Merge branch 'main' into test-ut-input-ephemeral-with-sql-format
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Apr 15, 2024
2 parents ade2378 + 607646b commit 845e566
Show file tree
Hide file tree
Showing 75 changed files with 1,339 additions and 809 deletions.
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20231005-151848.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump actions/checkout from 3 to 4"
time: 2023-10-05T15:18:48.00000Z
custom:
Author: dependabot[bot]
PR: 8781
Issue: 8781
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20231031-131954.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: Begin using DSI 0.4.x
time: 2023-10-31T13:19:54.750009-07:00
custom:
Author: QMalcolm peterallenwebb
PR: "8892"
Issue: "8892"
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20231106-130051.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: Update typing-extensions version to >=4.4
time: 2023-11-06T13:00:51.062386-08:00
custom:
Author: tlento
PR: "9012"
Issue: "9012"
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20231122-001840.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump ddtrace from 2.1.7 to 2.3.0"
time: 2023-11-22T00:18:40.00000Z
custom:
Author: dependabot[bot]
PR: 9132
Issue: 9132
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20231204-000945.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump freezegun from 0.3.12 to 1.3.0"
time: 2023-12-04T00:09:45.00000Z
custom:
Author: dependabot[bot]
PR: 9197
Issue: 9197
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20231211-005651.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump actions/setup-python from 4 to 5"
time: 2023-12-11T00:56:51.00000Z
custom:
Author: dependabot[bot]
PR: 9267
Issue: 9267
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240115-012030.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump actions/download-artifact from 3 to 4"
time: 2024-01-15T01:20:30.00000Z
custom:
Author: dependabot[bot]
PR: 9374
Issue: 9374
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240123-105843.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: remove dbt/adapters and add dependency on dbt-adapters
time: 2024-01-23T10:58:43.286952-08:00
custom:
Author: colin-rogers-dbt
PR: "9430"
Issue: "9430"
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240129-005734.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump actions/upload-artifact from 3 to 4"
time: 2024-01-29T00:57:34.00000Z
custom:
Author: dependabot[bot]
PR: 9470
Issue: 9470
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240129-005743.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump actions/cache from 3 to 4"
time: 2024-01-29T00:57:43.00000Z
custom:
Author: dependabot[bot]
PR: 9471
Issue: 9471
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240212-011324.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump peter-evans/create-pull-request from 5 to 6"
time: 2024-02-12T01:13:24.00000Z
custom:
Author: dependabot[bot]
PR: 9552
Issue: 9552
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240222-102947.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: Restrict protobuf to 4.* versions
time: 2024-02-22T10:29:47.595435-08:00
custom:
Author: QMalcolm
PR: "9566"
Issue: "9566"
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240226-004412.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: "Bump codecov/codecov-action from 3 to 4"
time: 2024-02-26T00:44:12.00000Z
custom:
Author: dependabot[bot]
PR: 9659
Issue: 9659
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240226-123502.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: Cap dbt-semantic-interfaces version range to <0.6
time: 2024-02-26T12:35:02.643779-08:00
custom:
Author: tlento
PR: "9671"
Issue: "9671"
2 changes: 1 addition & 1 deletion .changes/1.8.0/Dependencies-20240227-151115.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: bump dbt-common to accept major version 1
time: 2024-02-27T15:11:15.583604-05:00
custom:
Author: michelleark
PR: "9690"
Issue: "9690"
2 changes: 1 addition & 1 deletion .changes/1.8.0/Security-20240222-152445.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ body: Update Jinja2 to >= 3.1.3 to address CVE-2024-22195
time: 2024-02-22T15:24:45.158305-08:00
custom:
Author: QMalcolm
PR: CVE-2024-22195
Issue: 9638
6 changes: 6 additions & 0 deletions .changes/unreleased/Dependencies-20240117-100818.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Dependencies
body: Relax pathspec upper bound version restriction
time: 2024-01-17T10:08:18.009949641+01:00
custom:
Author: rzjfr
Issue: "9373"
6 changes: 6 additions & 0 deletions .changes/unreleased/Dependencies-20240331-103917.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Dependencies
body: Remove duplicate dependency of protobuf in dev-requirements
time: 2024-03-31T10:39:17.432017-07:00
custom:
Author: niteshy
Issue: "9830"
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20240404-170728.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: 'source freshness precomputes metadata-based freshness in batch, if possible '
time: 2024-04-04T17:07:28.717868-07:00
custom:
Author: michelleark
Issue: "8705"
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20240405-175733.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Better error message when trying to select a disabled model
time: 2024-04-05T17:57:33.047963+02:00
custom:
Author: SamuelBFavarin
Issue: "9747"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240108-232035.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: fix configuration of turning test warnings into failures with WARN_ERROR_OPTIONS
time: 2024-01-08T23:20:35.339102+09:00
custom:
Author: jx2lee
Issue: "7761"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240206-152435.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix conflict with newer versions of Snowplow tracker
time: 2024-02-06T15:24:35.778891-06:00
custom:
Author: edgarrmondragon akurdyukov
Issue: "8719"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240323-124558.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Only create the packages-install-path / dbt_packages folder during dbt deps
time: 2024-03-23T12:45:58.159017-06:00
custom:
Author: dbeatty10
Issue: 6985 9584
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240409-233347.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Begin warning people about spaces in model names
time: 2024-04-09T23:33:47.850166-07:00
custom:
Author: QMalcolm
Issue: "9397"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240412-095718.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Disambiguiate FreshnessConfigProblem error message
time: 2024-04-12T09:57:18.417882-07:00
custom:
Author: michelleark
Issue: "9891"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240412-132000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Remove non dbt.artifacts dbt.* imports from dbt/artifacts
time: 2024-04-12T13:20:00.017737-07:00
custom:
Author: michelleark
Issue: "9926"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240412-134502.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Migrate to using `error_tag` provided by `dbt-common`
time: 2024-04-12T13:45:02.879023-07:00
custom:
Author: QMalcolm
Issue: "9914"
52 changes: 4 additions & 48 deletions .changie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,7 @@ kinds:
- {{.Body}} ({{ range $index, $element := $IssueList }}{{if $index}}, {{end}}{{$element}}{{end}})
- label: Under the Hood
- label: Dependencies
changeFormat: |-
{{- $PRList := list }}
{{- $changes := splitList " " $.Custom.PR }}
{{- range $pullrequest := $changes }}
{{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/pull/nbr)" | replace "nbr" $pullrequest }}
{{- $PRList = append $PRList $changeLink }}
{{- end -}}
- {{.Body}} ({{ range $index, $element := $PRList }}{{if $index}}, {{end}}{{$element}}{{end}})
skipGlobalChoices: true
additionalChoices:
- key: Author
label: GitHub Username(s) (separated by a single space if multiple)
type: string
minLength: 3
- key: PR
label: GitHub Pull Request Number (separated by a single space if multiple)
type: string
minLength: 1
- label: Security
changeFormat: |-
{{- $PRList := list }}
{{- $changes := splitList " " $.Custom.PR }}
{{- range $pullrequest := $changes }}
{{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/pull/nbr)" | replace "nbr" $pullrequest }}
{{- $PRList = append $PRList $changeLink }}
{{- end -}}
- {{.Body}} ({{ range $index, $element := $PRList }}{{if $index}}, {{end}}{{$element}}{{end}})
skipGlobalChoices: true
additionalChoices:
- key: Author
label: GitHub Username(s) (separated by a single space if multiple)
type: string
minLength: 3
- key: PR
label: GitHub Pull Request Number (separated by a single space if multiple)
type: string
minLength: 1

newlines:
afterChangelogHeader: 1
Expand Down Expand Up @@ -106,18 +70,10 @@ footerFormat: |
{{- $changeList := splitList " " $change.Custom.Author }}
{{- $IssueList := list }}
{{- $changeLink := $change.Kind }}
{{- if or (eq $change.Kind "Dependencies") (eq $change.Kind "Security") }}
{{- $changes := splitList " " $change.Custom.PR }}
{{- range $issueNbr := $changes }}
{{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/pull/nbr)" | replace "nbr" $issueNbr }}
{{- $IssueList = append $IssueList $changeLink }}
{{- end -}}
{{- else }}
{{- $changes := splitList " " $change.Custom.Issue }}
{{- range $issueNbr := $changes }}
{{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/issues/nbr)" | replace "nbr" $issueNbr }}
{{- $IssueList = append $IssueList $changeLink }}
{{- end -}}
{{- $changes := splitList " " $change.Custom.Issue }}
{{- range $issueNbr := $changes }}
{{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/issues/nbr)" | replace "nbr" $issueNbr }}
{{- $IssueList = append $IssueList $changeLink }}
{{- end }}
{{- /* check if this contributor has other changes associated with them already */}}
{{- if hasKey $contributorDict $author }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bot-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
commit_message: "Add automated changelog yaml from template for bot PR"
changie_kind: ${{ matrix.changie_kind }}
label: ${{ matrix.label }}
custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n PR: ${{ github.event.pull_request.number }}"
custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n Issue: ${{ github.event.pull_request.number }}"
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:
- name: Install source distributions
# ignore dbt-1.0.0, which intentionally raises an error when installed from source
run: |
find ./dist/dbt-[a-z]*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
find ./dist/*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
- name: Check source distributions
run: |
Expand Down
1 change: 1 addition & 0 deletions core/dbt/artifacts/exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from dbt.artifacts.exceptions.schemas import IncompatibleSchemaError
31 changes: 31 additions & 0 deletions core/dbt/artifacts/exceptions/schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from typing import Optional

from dbt_common.exceptions import DbtRuntimeError


class IncompatibleSchemaError(DbtRuntimeError):
def __init__(self, expected: str, found: Optional[str] = None) -> None:
self.expected = expected
self.found = found
self.filename = "input file"

super().__init__(msg=self.get_message())

def add_filename(self, filename: str):
self.filename = filename
self.msg = self.get_message()

def get_message(self) -> str:
found_str = "nothing"
if self.found is not None:
found_str = f'"{self.found}"'

msg = (
f'Expected a schema version of "{self.expected}" in '
f"{self.filename}, but found {found_str}. Are you running with a "
f"different version of dbt?"
)
return msg

CODE = 10014
MESSAGE = "Incompatible Schema"
2 changes: 1 addition & 1 deletion core/dbt/artifacts/resources/v1/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from dbt_common.contracts.config.materialization import OnConfigurationChangeOption
from dbt.artifacts.resources.base import Docs
from dbt.artifacts.resources.types import ModelHookType
from dbt.contracts.graph.utils import validate_color
from dbt.artifacts.utils.validation import validate_color
from dbt import hooks
from mashumaro.jsonschema.annotations import Pattern

Expand Down
16 changes: 6 additions & 10 deletions core/dbt/artifacts/schemas/base.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import dataclasses
from datetime import datetime
import functools
from mashumaro.jsonschema import build_json_schema
from mashumaro.jsonschema.dialects import DRAFT_2020_12
from typing import ClassVar, Type, TypeVar, Dict, Any, Optional

from dbt_common.clients.system import write_json, read_json
from dbt.exceptions import (
DbtInternalError,
DbtRuntimeError,
IncompatibleSchemaError,
)
from dbt.version import __version__

from dbt_common.exceptions import DbtInternalError, DbtRuntimeError
from dbt_common.events.functions import get_metadata_vars
from dbt_common.invocation import get_invocation_id
from dbt_common.dataclass_schema import dbtClassMixin

from mashumaro.jsonschema import build_json_schema
from mashumaro.jsonschema.dialects import DRAFT_2020_12
import functools
from dbt.version import __version__
from dbt.artifacts.exceptions import IncompatibleSchemaError


BASE_SCHEMAS_URL = "https://schemas.getdbt.com/"
Expand Down
11 changes: 0 additions & 11 deletions core/dbt/artifacts/schemas/results.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from dbt.contracts.graph.nodes import ResultNode
from dbt_common.events.functions import fire_event
from dbt.events.types import TimingInfoCollected
from dbt_common.events.contextvars import get_node_info
from dbt_common.events.helpers import datetime_to_json_string
from dbt.logger import TimingProcessor
from dbt_common.utils import cast_to_str, cast_to_int
from dbt_common.dataclass_schema import dbtClassMixin, StrEnum

Expand Down Expand Up @@ -45,13 +41,6 @@ def __enter__(self):
def __exit__(self, exc_type, exc_value, traceback):
self.timing_info.end()
self.callback(self.timing_info)
# Note: when legacy logger is removed, we can remove the following line
with TimingProcessor(self.timing_info):
fire_event(
TimingInfoCollected(
timing_info=self.timing_info.to_msg_dict(), node_info=get_node_info()
)
)


class RunningStatus(StrEnum):
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/artifacts/schemas/run/v5/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from datetime import datetime


from dbt.contracts.graph.nodes import CompiledNode
from dbt.artifacts.resources import CompiledResource
from dbt.artifacts.schemas.base import (
BaseArtifactMetadata,
ArtifactMixin,
Expand Down Expand Up @@ -67,7 +67,7 @@ class RunResultOutput(BaseResult):

def process_run_result(result: RunResult) -> RunResultOutput:

compiled = isinstance(result.node, CompiledNode)
compiled = isinstance(result.node, CompiledResource)

return RunResultOutput(
unique_id=result.node.unique_id,
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def debug(ctx, **kwargs):

task = DebugTask(
ctx.obj["flags"],
None,
)

results = task.run()
Expand Down Expand Up @@ -464,7 +463,7 @@ def init(ctx, **kwargs):
"""Initialize a new dbt project."""
from dbt.task.init import InitTask

task = InitTask(ctx.obj["flags"], None)
task = InitTask(ctx.obj["flags"])

results = task.run()
success = task.interpret_results(results)
Expand Down
1 change: 0 additions & 1 deletion core/dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ def __init__(self, config) -> None:

def initialize(self):
make_directory(self.config.project_target_path)
make_directory(self.config.packages_install_path)

# creates a ModelContext which is converted to
# a dict for jinja rendering of SQL
Expand Down
Empty file.
Loading

0 comments on commit 845e566

Please sign in to comment.