internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: dbt-labs/dbt-core

Issue:
[CT-2418] Update exception message for docs redirect
Redirect `/publish/` &rarr; `/govern/` in:

https://github.com/dbt-labs/dbt-core/blob/a88f64039583b1fce764408c841b22963d4908b8/core/dbt/exceptions.py#L247

(It still works, because we added a redirect to the docs site, but it would still be better to include the latest URL)


Discussion:

Resolving patch:
diff --git a/core/dbt/exceptions.py b/core/dbt/exceptions.py
--- a/core/dbt/exceptions.py
+++ b/core/dbt/exceptions.py
@@ -244,7 +244,7 @@ def message(self):
             "While comparing to previous project state, dbt detected a breaking change to an enforced contract."
             f"\n\n{reasons}\n\n"
             "Consider making an additive (non-breaking) change instead, if possible.\n"
-            "Otherwise, create a new model version: https://docs.getdbt.com/docs/collaborate/publish/model-versions"
+            "Otherwise, create a new model version: https://docs.getdbt.com/docs/collaborate/govern/model-versions"
         )
 
 


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2426] Update `--help` text for `--populate-cache`
Added in https://github.com/dbt-labs/dbt-core/pull/7307

https://github.com/dbt-labs/dbt-core/blob/a88f64039583b1fce764408c841b22963d4908b8/core/dbt/cli/params.py#L242-L247


Discussion:

Resolving patch:
diff --git a/core/dbt/cli/params.py b/core/dbt/cli/params.py
--- a/core/dbt/cli/params.py
+++ b/core/dbt/cli/params.py
@@ -23,7 +23,7 @@
 cache_selected_only = click.option(
     "--cache-selected-only/--no-cache-selected-only",
     envvar="DBT_CACHE_SELECTED_ONLY",
-    help="Pre cache database objects relevant to selected resource only.",
+    help="At start of run, populate relational cache only for schemas containing selected nodes, or for all schemas of interest.",
 )
 
 introspect = click.option(
@@ -121,7 +121,7 @@
 
 log_cache_events = click.option(
     "--log-cache-events/--no-log-cache-events",
-    help="Enable verbose adapter cache logging.",
+    help="Enable verbose logging for relational cache events to help when debugging.",
     envvar="DBT_LOG_CACHE_EVENTS",
 )
 
@@ -242,7 +242,7 @@
 populate_cache = click.option(
     "--populate-cache/--no-populate-cache",
     envvar="DBT_POPULATE_CACHE",
-    help="Allow for partial parsing by looking for and writing to a pickle file in the target directory. This overrides the user configuration file.",
+    help="At start of run, use `show` or `information_schema` queries to populate a relational cache, which can speed up subsequent materializations.",
     default=True,
 )
 


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2432] [CT-2431] [Bug] sqlparse patch version 0.4.4 breaks ephemeral models
### Description

This is just for Ubuntu and not Mac or Windows. 

Failing errors can be seen here:
https://github.com/dbt-labs/dbt-core/actions/runs/4731122949

### Environment

```markdown
- OS:
- Python:
- dbt:all dbt versions
```



Discussion:

Resolving patch:
diff --git a/core/setup.py b/core/setup.py
--- a/core/setup.py
+++ b/core/setup.py
@@ -63,7 +63,7 @@
         "minimal-snowplow-tracker==0.0.2",
         "networkx>=2.3,<2.8.4",
         "packaging>=20.9,<22.0",
-        "sqlparse>=0.2.3,<0.5",
+        "sqlparse>=0.2.3,<0.4.4",
         "dbt-extractor~=0.4.1",
         "typing-extensions>=3.7.4",
         "werkzeug>=1,<3",


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2439] [Bug] dbt source freshness'output(_dir) not using target-path specified in dbt_project.yml
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

`dbt source freshness` will write `sources.json` to default running dir instead of respecting the target-dir specified in `dbt_project.yml`.

### Expected Behavior

When a target-path is specified in `dbt_project.yml`, dbt-core would write sources.json to that path.

### Steps To Reproduce

Specify a `target-path` in `dbt_project.yml` that's different from default path. Run source freshness. You will see `sources.json` being written to the target dir in the current path not the path specified in `dbt_project.yml`




Discussion:

Resolving patch:
diff --git a/core/dbt/cli/params.py b/core/dbt/cli/params.py
--- a/core/dbt/cli/params.py
+++ b/core/dbt/cli/params.py
@@ -1,4 +1,4 @@
-from pathlib import Path, PurePath
+from pathlib import Path
 
 import click
 from dbt.cli.options import MultiOption
@@ -229,7 +229,7 @@
     envvar=None,
     help="Specify the output path for the JSON report. By default, outputs to 'target/sources.json'",
     type=click.Path(file_okay=True, dir_okay=False, writable=True),
-    default=PurePath.joinpath(Path.cwd(), "target/sources.json"),
+    default=None,
 )
 
 partial_parse = click.option(


Test patch:
diff --git a/tests/functional/sources/test_source_freshness.py b/tests/functional/sources/test_source_freshness.py
--- a/tests/functional/sources/test_source_freshness.py
+++ b/tests/functional/sources/test_source_freshness.py
@@ -187,8 +187,15 @@ def test_source_snapshot_freshness(self, project):
 
 
 class TestSourceFreshnessSelection(SuccessfulSourceFreshnessTest):
-    def test_source_freshness_selection_select(self, project):
+    @pytest.fixture(scope="class")
+    def project_config_update(self, logs_dir):
+        return {
+            "target-path": logs_dir,
+        }
+
+    def test_source_freshness_selection_select(self, project, logs_dir):
         """Tests node selection using the --select argument."""
+        """Also validate that specify a target-path works as expected."""
         self._set_updated_at_to(project, timedelta(hours=-2))
         # select source directly
         results = self.run_dbt_with_vars(
@@ -198,13 +205,11 @@ def test_source_freshness_selection_select(self, project):
                 "freshness",
                 "--select",
                 "source:test_source.test_table",
-                "-o",
-                "target/pass_source.json",
             ],
         )
         assert len(results) == 1
         assert results[0].status == "pass"
-        self._assert_freshness_results("target/pass_source.json", "pass")
+        self._assert_freshness_results(f"{logs_dir}/sources.json", "pass")
 
 
 class TestSourceFreshnessExclude(SuccessfulSourceFreshnessTest):
Repository: dbt-labs/dbt-core

Issue:
[CT-2443] [Regression] `dbt snapshot` command uses target path, but does not have a CLI option to specify it.
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

the `dbt snapshot` command does not have a `--target-path` option.

### Expected Behavior

Because the `dbt snapshot` command uses the target path as part of its runtime, I expected that you would also be able to specify it. This is also a regression from our end (we are upgrading from dbt 1.1 to 1.5), as we were using a custom target path to run everything out of.

### Steps To Reproduce

Attempt the command `dbt snapshot --target-path my/custom/path`.

### Relevant log output

_No response_

### Environment

```markdown
- OS: OSX
- Python: 3.10
- dbt: 1.5 beta
```


### Which database adapter are you using with dbt?

snowflake

### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py
--- a/core/dbt/cli/main.py
+++ b/core/dbt/cli/main.py
@@ -650,6 +650,7 @@ def seed(ctx, **kwargs):
 @p.state
 @p.deprecated_state
 @p.target
+@p.target_path
 @p.threads
 @p.vars
 @requires.postflight


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2535] [Regression] Print flag inverted in dbt v1.5.0
### Is this a regression in a recent version of dbt-core?

- [X] I believe this is a regression in dbt-core functionality
- [X] I have searched the existing issues, and I could not find an existing issue for this regression

### Current Behavior

The print macro only seems to work with the `--no-print` flag set. While `--print` seems to disable printing.


### Expected/Previous Behavior

The print macro printing by default, and not when `--no-print` flag set

### Steps To Reproduce

Using dbt-core==1.5.0
Create a macro file print_test.sql with this code:
```jinja
{% macro print_test() -%}

    {{ print("Hello world") }}

{%- endmacro %}
```
Run the macro with `--print` flag set
```
dbt --print run-operation print_test
```
It produces no output

Run the macro with `--no-print` flag set
```
dbt --no-print run-operation print_test
```
It outputs "Hello world"

### Relevant log output

_No response_

### Environment

```markdown
- OS: Windows 10 v21H2
- Python: 3.10.8
- dbt (working version): 1.4.5
- dbt (regression version): 1.5.0
```


### Which database adapter are you using with dbt?

snowflake

### Additional Context

It seems like this check might be inverted: https://github.com/dbt-labs/dbt-core/blob/fd7306643fd3a98e3232cbc15bf50eb2f3733603/core/dbt/context/base.py#L655


Discussion:

Resolving patch:
diff --git a/core/dbt/context/base.py b/core/dbt/context/base.py
--- a/core/dbt/context/base.py
+++ b/core/dbt/context/base.py
@@ -652,7 +652,7 @@ def print(msg: str) -> str:
             {% endmacro %}"
         """
 
-        if not get_flags().PRINT:
+        if get_flags().PRINT:
             print(msg)
         return ""
 


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2450] Add `exp_path` back to project config deprecation warning
In https://github.com/dbt-labs/dbt-core/pull/7185 I accidentally cut `exp_path`!

https://github.com/dbt-labs/dbt-core/blob/1722079a43d1e3a94ffb73e66c8712ee0837e9fa/core/dbt/config/project.py#L315-L321

https://github.com/dbt-labs/dbt-core/blob/828d723512fced809c63e369a82c7eb570a74986/core/dbt/events/types.py#L283

https://github.com/dbt-labs/dbt-core/blob/828d723512fced809c63e369a82c7eb570a74986/core/dbt/events/types.py#L295

```
The `source-paths` config has been renamed to ``.Please update your
`dbt_project.yml` configuration to reflect this change.
```


Discussion:

Resolving patch:
diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py
--- a/core/dbt/config/project.py
+++ b/core/dbt/config/project.py
@@ -315,10 +315,10 @@ def check_config_path(
             # this field is no longer supported, but many projects may specify it with the default value
             # if so, let's only raise this deprecation warning if they set a custom value
             if not default_value or project_dict[deprecated_path] != default_value:
-                deprecations.warn(
-                    f"project-config-{deprecated_path}",
-                    deprecated_path=deprecated_path,
-                )
+                kwargs = {"deprecated_path": deprecated_path}
+                if expected_path:
+                    kwargs.update({"exp_path": expected_path})
+                deprecations.warn(f"project-config-{deprecated_path}", **kwargs)
 
     def create_project(self, rendered: RenderComponents) -> "Project":
         unrendered = RenderComponents(
diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py
--- a/core/dbt/events/types.py
+++ b/core/dbt/events/types.py
@@ -280,7 +280,7 @@ def code(self):
 
     def message(self):
         description = (
-            f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`."
+            f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`. "
             "Please update your `dbt_project.yml` configuration to reflect this change."
         )
         return line_wrap_message(warning_tag(f"Deprecated functionality\n\n{description}"))
@@ -292,7 +292,7 @@ def code(self):
 
     def message(self):
         description = (
-            f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`."
+            f"The `{self.deprecated_path}` config has been renamed to `{self.exp_path}`. "
             "Please update your `dbt_project.yml` configuration to reflect this change."
         )
         return line_wrap_message(warning_tag(f"Deprecated functionality\n\n{description}"))


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2727] [Bug] dbt docs serve edits the manifest.json
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

When I run dbt docs serve --port 8000 it edits the manifest.json, the index.html, and the partial_parse.msgpack in the target folder.

I have verified that this edit happens by looking at the last modified timestamp on the file as well as by manually making edits to the json which then are reverted upon running docs serve.

### Expected Behavior

dbt docs serve --port 8000 to not edit any files in the target folder

### Steps To Reproduce

Unclear if other are able to replicate this. I'm using dbt-core=1.5.0 and dbt-bigquery=1.5.0 on linux.

These are steps I can take to replicate 
1. opened a terminal
2. activate the virtual environment I use for dbt, containing dbt-core and dbt-bigquery
3. used cd to navigate to the dbt project folder
4. ran ‘dbt docs serve --port 8000’

I have a single terminal open on the local machine and am not hosting documentation. I have tried restarting the machine first.

### Relevant log output

```shell
N/A
```


### Environment

```markdown
- OS: Debian 4.19.0-24-cloud-amd64
- Python: 3.7.12
- dbt:1.5.0
```


### Which database adapter are you using with dbt?

bigquery

### Additional Context

See [here](https://discourse.getdbt.com/t/dbt-docs-serve-edits-manifest-json/8727/9) for original issue and discussion.


Discussion:

Resolving patch:
diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py
--- a/core/dbt/cli/main.py
+++ b/core/dbt/cli/main.py
@@ -290,13 +290,11 @@ def docs_generate(ctx, **kwargs):
 @requires.profile
 @requires.project
 @requires.runtime_config
-@requires.manifest
 def docs_serve(ctx, **kwargs):
     """Serve the documentation website for your project"""
     task = ServeTask(
         ctx.obj["flags"],
         ctx.obj["runtime_config"],
-        ctx.obj["manifest"],
     )
 
     results = task.run()


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2552] Pin protobuf to greater than 4.0
Some users were seeing an error:

> ImportError: cannot import name 'builder' from 'google.protobuf.internal'.
The generated types_pb2.py file was built with protobuf 4 and requires protobuf 4 in order to import "builder".


Discussion:

Resolving patch:
diff --git a/core/setup.py b/core/setup.py
--- a/core/setup.py
+++ b/core/setup.py
@@ -63,7 +63,7 @@
         "typing-extensions>=3.7.4",
         "werkzeug>=1,<3",
         "pathspec>=0.9,<0.12",
-        "protobuf>=3.18.3",
+        "protobuf>=4.0.0",
         "pytz>=2015.7",
         # the following are all to match snowflake-connector-python
         "requests<3.0.0",


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2556] [Bug] urllib3 upgraded to 2.0, dropping support for OpenSSL < 1.1.1, breaking requests 2.29.0
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

Running functional tests produces an error when trying to import requests:
```
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips  26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168
```

### Expected Behavior

Functional tests run as expected.

### Steps To Reproduce

1. Rebuild your venv to pick up the latest versions of dependencies
2. Run functional tests

### Relevant log output

```shell
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips  26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168
```
```


### Environment

```markdown
- OS: any
- Python: any
- dbt: any that use urllib3 (likely via having no cap on urllib3)
```


### Which database adapter are you using with dbt?

_No response_

### Additional Context

Related issues:
https://github.com/urllib3/urllib3/issues/2168
https://github.com/psf/requests/issues/6432
https://github.com/urllib3/urllib3/releases/tag/2.0.0

Proposed Solution:
We need to pin urllib3 to 1.x


Discussion:

Resolving patch:
diff --git a/core/setup.py b/core/setup.py
--- a/core/setup.py
+++ b/core/setup.py
@@ -70,6 +70,7 @@
         "idna>=2.5,<4",
         "cffi>=1.9,<2.0.0",
         "pyyaml>=6.0",
+        "urllib3~=1.0",
     ],
     zip_safe=False,
     classifiers=[


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2479] replace all instances of set-output and node16
Details in https://github.com/dbt-labs/actions/issues/39.

### Acceptance Criteria
- [ ] Verified there are no workflows to update
_or_
- [ ] removed all uses of `set-output` - either directly or up updating any marketplace actions we reference
- [ ] removed all references to node16 - either directly or up updating any marketplace actions we reference
- [ ] backport changes


Discussion:

Resolving patch:
diff --git a/.github/actions/latest-wrangler/main.py b/.github/actions/latest-wrangler/main.py
--- a/.github/actions/latest-wrangler/main.py
+++ b/.github/actions/latest-wrangler/main.py
@@ -28,11 +28,12 @@
     if package_request.status_code == 404:
         if halt_on_missing:
             sys.exit(1)
-        else:
-            # everything is the latest if the package doesn't exist
-            print(f"::set-output name=latest::{True}")
-            print(f"::set-output name=minor_latest::{True}")
-            sys.exit(0)
+        # everything is the latest if the package doesn't exist
+        github_output = os.environ.get("GITHUB_OUTPUT")
+        with open(github_output, "at", encoding="utf-8") as gh_output:
+            gh_output.write("latest=True")
+            gh_output.write("minor_latest=True")
+        sys.exit(0)
 
     # TODO: verify package meta is "correct"
     # https://github.com/dbt-labs/dbt-core/issues/4640
@@ -91,5 +92,7 @@ def is_latest(
     latest = is_latest(pre_rel, new_version, current_latest)
     minor_latest = is_latest(pre_rel, new_version, current_minor_latest)
 
-    print(f"::set-output name=latest::{latest}")
-    print(f"::set-output name=minor_latest::{minor_latest}")
+    github_output = os.environ.get("GITHUB_OUTPUT")
+    with open(github_output, "at", encoding="utf-8") as gh_output:
+        gh_output.write(f"latest={latest}")
+        gh_output.write(f"minor_latest={minor_latest}")


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[Regression] --target-path is needed in more CLI commands.
### Is this a regression in a recent version of dbt-core?

- [X] I believe this is a regression in dbt-core functionality
- [X] I have searched the existing issues, and I could not find an existing issue for this regression

### Current Behavior

`dbt [subcommand] --target-path` is needed in more subcommands.

### Expected/Previous Behavior

If I run `dbt [subcommand]` and a `target/` is created in the PWD (when one previously did not exist), then I expect that I should be able to parameterize this in the CLI.

### Steps To Reproduce

Test all the subcommands with `dbt [subcommand]` and see which ones create a `target/` dir if one does not exist in the PWD.

### Relevant log output

_No response_

### Environment

```markdown
- OS: OSX
- Python: 3.10
- dbt: 1.5.0
```


### Which database adapter are you using with dbt?

snowflake

### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py
--- a/core/dbt/cli/main.py
+++ b/core/dbt/cli/main.py
@@ -213,6 +213,7 @@ def build(ctx, **kwargs):
 @p.profiles_dir
 @p.project_dir
 @p.target
+@p.target_path
 @p.vars
 @requires.postflight
 @requires.preflight
@@ -284,6 +285,7 @@ def docs_generate(ctx, **kwargs):
 @p.profiles_dir
 @p.project_dir
 @p.target
+@p.target_path
 @p.vars
 @requires.postflight
 @requires.preflight
@@ -477,6 +479,7 @@ def init(ctx, **kwargs):
 @p.state
 @p.deprecated_state
 @p.target
+@p.target_path
 @p.vars
 @requires.postflight
 @requires.preflight
@@ -577,6 +580,7 @@ def run(ctx, **kwargs):
 @p.profiles_dir
 @p.project_dir
 @p.target
+@p.target_path
 @p.vars
 @requires.postflight
 @requires.preflight
@@ -691,6 +695,7 @@ def source(ctx, **kwargs):
 @p.state
 @p.deprecated_state
 @p.target
+@p.target_path
 @p.threads
 @p.vars
 @requires.postflight


Test patch:
Repository: dbt-labs/dbt-core

Issue:
[CT-2585] [Feature] Relax PyYAML dependency requirement
### Is this your first time submitting a feature request?

- [X] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [X] I have searched the existing issues, and I could not find an existing issue for this feature
- [X] I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

Currently, the project requires pyyaml package, which makes it more restrictive https://github.com/dbt-labs/dbt-core/blob/main/core/setup.py#L72.

This dependency blocks our team to use kfp pipelines along with dbt-bigquery.

It is of great interest for us to relax this dependency to something like PyYAML>=5.3,<7. This will enable us to use dbt-bigquery along with kfp.



### Describe alternatives you've considered

Use pre-release version of kfp pipelines, which does not conflict with the project.

### Who will this benefit?

Vertex AI users who use kfp pipelines for orchestration.

### Are you interested in contributing this feature?

Yes

### Anything else?

_No response_


Discussion:
Thanks for reaching out @anisnasir !

It looks like this will be solved for you in [kfp 2.0.0](https://github.com/kubeflow/pipelines/blob/96742a648a270a776f6bc44bdb0801acbb9c5fc1/sdk/RELEASE.md?plain=1#L124).

@gshank do you know if the minimum PyYAML [here](https://github.com/dbt-labs/dbt-core/pull/5118/commits/b72044557d733a18ea671b5323b0349ac5ed942b) needs to be 6.0? Or is it it possible we can move the lower bound down to one of the earlier versions listed [here](https://pypi.org/project/PyYAML/#history)?

@anisnasir is asking if it can be lowered to PyYAML>=5.3. If even lower works, then it would be nice to make it as wide as possible in case there are other similar conflicts out there.
I think it would be fine to lower the requirement to >=5.3.  I'm hesitant to lower it further. Reading the changelogs, there are some possible problem areas, such as "Fix for Python 3.10"... Each earlier version would have to be tested separately, and on multiple versions of Python. 5.3.1 was 3 years ago, which feels like it ought to be adequate.
@anisnasir per @gshank you may open a PR to lower the bound to `pyyaml>=5.3` here:
https://github.com/dbt-labs/dbt-core/blob/87ea28fe84edd65d589fd3cf658d8dd1f65c000a/core/setup.py#L72

I will mark this as a `good_first_issue`.
https://github.com/dbt-labs/dbt-core/pull/7681 Here you go :) 

Resolving patch:
diff --git a/core/setup.py b/core/setup.py
--- a/core/setup.py
+++ b/core/setup.py
@@ -69,7 +69,7 @@
         "requests<3.0.0",
         "idna>=2.5,<4",
         "cffi>=1.9,<2.0.0",
-        "pyyaml>=6.0",
+        "pyyaml>=5.3",
         "urllib3~=1.0",
     ],
     zip_safe=False,


Test patch: