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

Release 1.4.2 #1028

Merged
merged 15 commits into from
Jun 6, 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
183 changes: 183 additions & 0 deletions .github/ISSUE_TEMPLATE/01-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
---
name: Bug Report
description: File a bug report.
title: "[Bug]: "
labels: ["bug", "triage-needed"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: dropdown
id: cosmos-version
attributes:
label: Astronomer Cosmos Version
description: What version of Astronomer Cosmos are you running? If you do not see your version in the list, please (ideally) test on
the latest release or main to see if the issue is fixed before reporting it.
options:
- "1.4.1"
- "main (development)"
- "Other Astronomer Cosmos version (please specify below)"
multiple: false
validations:
required: true
- type: input
attributes:
label: If "Other Astronomer Cosmos version" selected, which one?
# yamllint disable rule:line-length
description: >
On what version of Astronomer Cosmos are you currently experiencing the issue? Remember, you are encouraged to
test with the latest release or on the main branch to verify your issue still exists.
- type: input
id: dbt-core-version
attributes:
label: dbt-core version
description: What version of dbt-core are you running?
placeholder: ex. 1.8.0
validations:
required: true
- type: textarea
attributes:
label: Versions of dbt adapters
description: What dbt adapter versions are you using?
placeholder: You can use `pip freeze | grep dbt` (you can leave only relevant ones)
- type: dropdown
id: load-mode
attributes:
label: LoadMode
description: Which LoadMode are you using?
options:
- "AUTOMATIC"
- "CUSTOM"
- "DBT_LS"
- "DBT_LS_FILE"
- "DBT_LS_MANIFEST"
multiple: false
validations:
required: true
- type: dropdown
id: execution-mode
attributes:
label: ExecutionMode
description: Which ExecutionMode are you using?
options:
- "AWS_EKS"
- "AZURE_CONTAINER_INSTANCE"
- "DOCKER"
- "KUBERNETES"
- "LOCAL"
- "VIRTUALENV"
multiple: false
validations:
required: true
- type: dropdown
id: invocation-mode
attributes:
label: InvocationMode
description: Which InvocationMode are you using?
options:
- "DBT_RUNNER"
- "SUBPROCESS"
multiple: false
- type: input
id: airflow-version
attributes:
label: airflow version
description: What version of Apache Airflow are you running?
placeholder: ex. 2.9.0
validations:
required: true
- type: input
attributes:
label: Operating System
description: What Operating System are you using?
placeholder: "You can get it via `cat /etc/os-release` for example"
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: If a you think it's an UI issue, what browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: dropdown
attributes:
label: Deployment
description: >
What kind of deployment do you have?
multiple: false
options:
- "Official Apache Airflow Helm Chart"
- "Other 3rd-party Helm chart"
- "Docker-Compose"
- "Other Docker-based deployment"
- "Virtualenv installation"
- "Astronomer"
- "Google Cloud Composer"
- "Amazon (AWS) MWAA"
- "Microsoft ADF Managed Airflow"
- "Other"
validations:
required: true
- type: textarea
attributes:
label: Deployment details
description: Additional description of your deployment.
placeholder: >
Enter any relevant details of your deployment. Especially version of your tools,
software (docker-compose, helm, k8s, etc.), any customisation and configuration you added.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
attributes:
label: How to reproduce
description: What should we do to reproduce the problem?
placeholder: >
Please make sure you provide a reproducible step-by-step case of how to reproduce the problem
as minimally and precisely as possible. Keep in mind we do not have access to your cluster or DAGs.
Remember that non-reproducible issues make it hard for us to help you or resolve the issue!
validations:
required: true
- type: textarea
attributes:
label: Anything else :)?
description: Anything else we need to know?
placeholder: >
How often does this problem occur? (Once? Every time? Only when certain conditions are met?)
- type: checkboxes
attributes:
label: Are you willing to submit PR?
description: >
This is absolutely not required, but we are happy to guide you in the contribution process
especially if you already have a good understanding of how to implement the fix. We love to bring new
contributors in.
options:
- label: Yes I am willing to submit a PR!
- type: input
id: contact
attributes:
label: Contact Details
description: (Optional) How can we get in touch with you if we need more info?
placeholder: ex. [email protected]
validations:
required: false
- type: markdown
attributes:
value: "Thanks for completing our form!"
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/02-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Feature request
description: Suggest an idea for this project
labels: ["enhancement", "needs-triage"]
body:
- type: markdown
attributes:
# yamllint disable rule:line-length
value: "
Thank you for finding the time to propose new feature!

We really appreciate the community efforts to improve Cosmos."
# yamllint enable rule:line-length
- type: textarea
attributes:
label: Description
description: A short description of your feature
- type: textarea
attributes:
label: Use case/motivation
description: What would you like to happen?
- type: textarea
attributes:
label: Related issues
description: Is there currently another issue associated with this?
- type: checkboxes
attributes:
label: Are you willing to submit a PR?
options:
- label: Yes, I am willing to submit a PR!
- type: markdown
attributes:
value: "Thanks for completing our form!"
16 changes: 15 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9"]
exclude:
- python-version: "3.11"
airflow-version: "2.4"
# Apache Airflow versions prior to 2.9.0 have not been tested with Python 3.12.
# Official support for Python 3.12 and the corresponding constraints.txt are available only for Apache Airflow >= 2.9.0.
# See: https://github.com/apache/airflow/tree/2.9.0?tab=readme-ov-file#requirements
# See: https://github.com/apache/airflow/tree/2.8.4?tab=readme-ov-file#requirements
- python-version: "3.12"
airflow-version: "2.4"
- python-version: "3.12"
airflow-version: "2.5"
- python-version: "3.12"
airflow-version: "2.6"
- python-version: "3.12"
airflow-version: "2.7"
- python-version: "3.12"
airflow-version: "2.8"
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
args: ["--autofix"]
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
name: Run codespell to check for common misspellings in files
Expand Down Expand Up @@ -54,7 +54,7 @@ repos:
- --py37-plus
- --keep-runtime-typing
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
rev: v0.4.7
hooks:
- id: ruff
args:
Expand Down
40 changes: 33 additions & 7 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
Changelog
=========

1.4.2 (2024-06-06)
------------------

Bug fixes

* Fix the invocation mode for ``ExecutionMode.VIRTUALENV`` by @marco9663 in #1023
* Fix Cosmos ``enable_cache`` setting by @tatiana in #1025
* Make ``GoogleCloudServiceAccountDictProfileMapping`` dataset profile arg optional by @oliverrmaa and @pankajastro in #839 and #1017
* Athena profile mapping set ``aws_session_token`` in profile only if it exists by @pankajastro in #1022

Others

* Update dbt and Airflow conflicts matrix by @tatiana in #1026
* Enable Python 3.12 unittest by @pankajastro in #1018
* Improve error logging in ``DbtLocalBaseOperator`` by @davidsteinar in #1004
* Add GitHub issue templates for bug reports and feature request by @pankajkoti in #1009
* Add more fields in bug template to reduce turnaround in issue triaging by @pankajkoti in #1027
* Fix ``dev/Dockerfile`` + Add ``uv pip install`` for faster build time by @dwreeves in #997
* Drop support for Airflow 2.3 by @pankajkoti in #994
* Update Astro Runtime image by @RNHTTR in #988 and #989
* Enable ruff F linting by @pankajastro in #985
* Move Cosmos Airflow configuration to settings.py by @pankajastro in #975
* Fix CI Issues by @tatiana in #1005
* Pre-commit hook updates in #1000, #1019


1.4.1 (2024-05-17)
--------------------
------------------

Bug fixes

* Fix manifest testing behavior in #955 by @chris-okorodudu
* Handle ValueError when unpacking partial_parse.msgpack in #972 by @tatiana
* Fix manifest testing behavior by @chris-okorodudu in #955
* Handle ValueError when unpacking partial_parse.msgpack by @tatiana in #972

Others

* Enable pre-commit run and fix type-check job by @pankajastro in #957
* Clean databricks credentials in test/CI in #969 by @tatiana
* Update CODEOWNERS in #969 by @tatiana
* Update emeritus contributors list in #961 by @tatiana
* Promote @dwreeves to committer in #960 by @tatiana
* Clean databricks credentials in test/CI by @tatiana in #969
* Update CODEOWNERS by @tatiana in #969 x
* Update emeritus contributors list by @tatiana in #961
* Promote @dwreeves to committer by @tatiana in #960
* Pre-commit hook updates in #956


Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

Expand Down
2 changes: 1 addition & 1 deletion cosmos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Contains dags, task groups, and operators.
"""
__version__ = "1.4.1"
__version__ = "1.4.2"


from cosmos.airflow.dag import DbtDag
Expand Down
16 changes: 14 additions & 2 deletions cosmos/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ class ExecutionConfig:
project_path: Path | None = field(init=False)

def __post_init__(self, dbt_project_path: str | Path | None) -> None:
if self.invocation_mode and self.execution_mode != ExecutionMode.LOCAL:
raise CosmosValueError("ExecutionConfig.invocation_mode is only configurable for ExecutionMode.LOCAL.")
if self.invocation_mode and self.execution_mode not in (ExecutionMode.LOCAL, ExecutionMode.VIRTUALENV):
raise CosmosValueError(
"ExecutionConfig.invocation_mode is only configurable for ExecutionMode.LOCAL and ExecutionMode.VIRTUALENV."
)
if self.execution_mode == ExecutionMode.VIRTUALENV:
if self.invocation_mode == InvocationMode.DBT_RUNNER:
raise CosmosValueError(
"InvocationMode.DBT_RUNNER has not been implemented for ExecutionMode.VIRTUALENV"
)
elif self.invocation_mode is None:
logger.debug(
"Defaulting to InvocationMode.SUBPROCESS as it is the only supported invocation mode for ExecutionMode.VIRTUALENV"
)
self.invocation_mode = InvocationMode.SUBPROCESS
self.project_path = Path(dbt_project_path) if dbt_project_path else None
6 changes: 2 additions & 4 deletions cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,8 @@ def handle_exception_subprocess(self, result: FullOutputSubprocessResult) -> Non
if self.skip_exit_code is not None and result.exit_code == self.skip_exit_code:
raise AirflowSkipException(f"dbt command returned exit code {self.skip_exit_code}. Skipping.")
elif result.exit_code != 0:
raise AirflowException(
f"dbt command failed. The command returned a non-zero exit code {result.exit_code}. Details: ",
*result.full_output,
)
logger.error("\n".join(result.full_output))
raise AirflowException(f"dbt command failed. The command returned a non-zero exit code {result.exit_code}.")

def handle_exception_dbt_runner(self, result: dbtRunnerResult) -> None:
"""dbtRunnerResult has an attribute `success` that is False if the command failed."""
Expand Down
4 changes: 3 additions & 1 deletion cosmos/profiles/athena/access_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ def profile(self) -> dict[str, Any | None]:
**self.profile_args,
"aws_access_key_id": self.temporary_credentials.access_key,
"aws_secret_access_key": self.get_env_var_format("aws_secret_access_key"),
"aws_session_token": self.get_env_var_format("aws_session_token"),
}

if self.temporary_credentials.token:
profile["aws_session_token"] = self.get_env_var_format("aws_session_token")

return self.filter_null(profile)

@property
Expand Down
Loading
Loading