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.0 #934

Merged
merged 11 commits into from
May 13, 2024
Merged

Release 1.4.0 #934

merged 11 commits into from
May 13, 2024

Conversation

tatiana
Copy link
Collaborator

@tatiana tatiana commented May 2, 2024

Features

Bug fixes

Docs

Others

Copy link

netlify bot commented May 2, 2024

Deploy Preview for sunny-pastelito-5ecb04 ready!

Name Link
🔨 Latest commit 8c9d6d4
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/66420f77a4e4250008f482ad
😎 Deploy Preview https://deploy-preview-934--sunny-pastelito-5ecb04.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.72%. Comparing base (4521533) to head (8c9d6d4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #934   +/-   ##
=======================================
  Coverage   95.72%   95.72%           
=======================================
  Files          59       59           
  Lines        2877     2877           
=======================================
  Hits         2754     2754           
  Misses        123      123           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tatiana tatiana mentioned this pull request May 2, 2024
tatiana added a commit that referenced this pull request May 2, 2024
It seems the [google/re2](https://github.com/google/re2) release
`1.1.20240501` is leading to an initialization issue in Netlify:
```
2:32:59 PM:     Running setup.py install for google-re2: finished with status 'error'
2:32:59 PM:     ERROR: Command errored out with exit status 1:
2:32:59 PM:      command: /opt/buildhome/python3.8/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"/tmp/pip-install-ti3twlby/google-re2/setup.py"'; __file__='"/tmp/pip-install-ti3twlby/google-re2/setup.py"';f=getattr(tokenize, '"open"', open)(__file__);code=f.read().replace('"rn"', '"n"');f.close();exec(compile(code, __file__, '"exec"'))' install --record /tmp/pip-record-8yg4w9lc/install-record.txt --single-version-externally-managed --compile --install-headers /opt/buildhome/python3.8/include/site/python3.8/google-re2
2:32:59 PM:          cwd: /tmp/pip-install-ti3twlby/google-re2/
2:32:59 PM:     Complete output (28 lines):
2:32:59 PM:     running install
2:32:59 PM:     /opt/buildhome/python3.8/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
2:32:59 PM:     git checkout main
2:32:59 PM:             ********************************************************************************
2:32:59 PM:             Please avoid running setup.py directly.
2:32:59 PM:             Instead, use pypa/build, pypa/installer or other
2:32:59 PM:             standards-based tools.
2:32:59 PM:             See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
2:32:59 PM:             ********************************************************************************
2:32:59 PM:     git checkout main
2:32:59 PM:       self.initialize_options()
2:32:59 PM:     running build
2:32:59 PM:     running build_py
2:32:59 PM:     creating build
2:32:59 PM:     creating build/lib.linux-x86_64-cpython-38
2:32:59 PM:     copying re2.py -> build/lib.linux-x86_64-cpython-38
2:32:59 PM:     running build_ext
2:32:59 PM:     building '_re2' extension
2:32:59 PM:     creating build/temp.linux-x86_64-cpython-38
2:32:59 PM:     x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/opt/buildhome/python3.8/lib/python3.8/site-packages/pybind11/include -I/opt/buildhome/python3.8/include -I/usr/include/python3.8 -c _re2.cc -o build/temp.linux-x86_64-cpython-38/_re2.o -fvisibility=hidden
2:32:59 PM:     _re2.cc:13:10: fatal error: absl/strings/string_view.h: No such file or directory
2:32:59 PM:        13 | #include absl/strings/string_view.h
2:32:59 PM:           |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2:32:59 PM:     compilation terminated.
2:32:59 PM:     error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
2:32:59 PM:     ----------------------------------------
2:33:00 PM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
2:33:00 PM: ERROR: Command errored out with exit status 1: /opt/buildhome/python3.8/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"/tmp/pip-install-ti3twlby/google-re2/setup.py"'; __file__='"/tmp/pip-install-ti3twlby/google-re2/setup.py"';f=getattr(tokenize, '"open"', open)(__file__);code=f.read().replace('"rn"', '"n"');f.close();exec(compile(code, __file__, '"exec"'))' install --record /tmp/pip-record-8yg4w9lc/install-record.txt --single-version-externally-managed --compile --install-headers /opt/buildhome/python3.8/include/site/python3.8/google-re2 Check the logs for full command output.
```

As seen in:

https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/663395dcce3dc1000843d9fd

During the Cosmos release 1.4.0:
#934
@tatiana tatiana marked this pull request as ready for review May 2, 2024 13:49
@tatiana tatiana requested a review from a team as a code owner May 2, 2024 13:49
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 2, 2024
@dosubot dosubot bot added area:dependencies Related to dependencies, like Python packages, library versions, etc area:docs Relating to documentation, changes, fixes, improvement area:execution Related to the execution environment/mode, like Docker, Kubernetes, Local, VirtualEnv, etc area:parsing Related to parsing DAG/DBT improvement, issues, or fixes area:performance Related to performance, like memory usage, CPU usage, speed, etc dbt:build Primarily related to dbt build command or functionality dbt:docs Primarily related to dbt docs command or functionality profile:databricks Related to Databricks ProfileConfig profile:postgres Related to Postgres ProfileConfig profile:trino Related to Trino ProfileConfig labels May 2, 2024
@tatiana
Copy link
Collaborator Author

tatiana commented May 2, 2024

We need to address at least two issues found while validating 1.4.0a2 before we do the stable release:

(1) Make sure we're able to change https://github.com/astronomer/cosmos-demo/blob/main/dags/basic/simple_dag.py to use render_config=RenderConfig(enable_mock_profile=False), and it works

(2) Make sure Cosmos will not raise the following exception when running dbt init in a project that uses DbtDag:

ERROR [airflow.models.dagbag.DagBag] Failed to import: /Users/pankajkoti/astronomer/astronomer-cosmos/dags/example_cosmos_python_models.py
Traceback (most recent call last):
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/airflow/models/dagbag.py", line 346, in parse
    loader.exec_module(new_module)
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/dags/example_cosmos_python_models.py", line 20, in <module>
    from cosmos import DbtDag, ProfileConfig, ProjectConfig
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/__init__.py", line 11, in <module>
    from cosmos.airflow.dag import DbtDag
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/airflow/dag.py", line 11, in <module>
    from cosmos.converter import DbtToAirflowConverter, airflow_kwargs, specific_kwargs
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/converter.py", line 15, in <module>
    from cosmos.airflow.graph import build_airflow_graph
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/airflow/graph.py", line 9, in <module>
    from cosmos.config import RenderConfig
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/config.py", line 24, in <module>
    from cosmos.profiles import BaseProfileMapping
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/profiles/__init__.py", line 7, in <module>
    from .athena import AthenaAccessKeyProfileMapping
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/profiles/athena/__init__.py", line 3, in <module>
    from .access_key import AthenaAccessKeyProfileMapping
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/profiles/athena/access_key.py", line 8, in <module>
    from ..base import BaseProfileMapping
  File "/Users/pankajkoti/astronomer/astronomer-cosmos/cosmos/lib/python3.8/site-packages/cosmos/profiles/base.py", line 14, in <module>
    from pydantic import dataclasses
ModuleNotFoundError: No module named 'pydantic'

Links to the issues:

@tatiana
Copy link
Collaborator Author

tatiana commented May 13, 2024

After solving the previously observed issues, we found two new topics:
(1) With Airflow 2.9.0/2.91: #948
(2) With Kubernetes: https://astronomer.github.io/astronomer-cosmos/getting_started/kubernetes.html#kubernetes. Since the change #899 broke the example DAG.

For (1), for now, we improved the log message in Cosmos - and we're fixing the root issue in Airflow itself.
For (2), we (@pankajkoti @pankajastro and I) paired on the fix and we'll merge it before the release

Copy link
Contributor

@pankajastro pankajastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 13, 2024
Copy link
Contributor

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to rebase to include recent fixes including #954 as a commit in the tree?

tatiana added 11 commits May 13, 2024 14:01
Faced while running the following command in the CI (I was not able to reproduce this locally):
```
Run python -m build
```

Resulted in the stacktrace:
```
    val = self.func(instance)
  File "/tmp/build-env-o83v4k67/lib/python3.10/site-packages/hatchling/builders/wheel.py", line 247, in default_file_selection_options
    raise ValueError(message)
ValueError: Unable to determine which files to ship inside the wheel using the following heuristics: https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection

The most likely cause of this is that there is no directory that matches the name of your project (astronomer_cosmos).

At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: https://hatch.pypa.io/latest/config/build/

As an example, if you intend to ship a directory named `foo` that resides within a `src` directory located at the root of your project, you can define the following:

[tool.hatch.build.targets.wheel]
packages = ["src/foo"]

ERROR Backend subprocess exited when trying to invoke build_wheel
```

As seen in:
https://github.com/astronomer/astronomer-cosmos/actions/runs/8986616060/job/24683237685
@tatiana tatiana merged commit 7794494 into main May 13, 2024
70 of 71 checks passed
@tatiana tatiana deleted the release-1.4.0 branch May 13, 2024 13:28
arojasb3 pushed a commit to arojasb3/astronomer-cosmos that referenced this pull request Jul 14, 2024
It seems the [google/re2](https://github.com/google/re2) release
`1.1.20240501` is leading to an initialization issue in Netlify:
```
2:32:59 PM:     Running setup.py install for google-re2: finished with status 'error'
2:32:59 PM:     ERROR: Command errored out with exit status 1:
2:32:59 PM:      command: /opt/buildhome/python3.8/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"/tmp/pip-install-ti3twlby/google-re2/setup.py"'; __file__='"/tmp/pip-install-ti3twlby/google-re2/setup.py"';f=getattr(tokenize, '"open"', open)(__file__);code=f.read().replace('"rn"', '"n"');f.close();exec(compile(code, __file__, '"exec"'))' install --record /tmp/pip-record-8yg4w9lc/install-record.txt --single-version-externally-managed --compile --install-headers /opt/buildhome/python3.8/include/site/python3.8/google-re2
2:32:59 PM:          cwd: /tmp/pip-install-ti3twlby/google-re2/
2:32:59 PM:     Complete output (28 lines):
2:32:59 PM:     running install
2:32:59 PM:     /opt/buildhome/python3.8/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
2:32:59 PM:     git checkout main
2:32:59 PM:             ********************************************************************************
2:32:59 PM:             Please avoid running setup.py directly.
2:32:59 PM:             Instead, use pypa/build, pypa/installer or other
2:32:59 PM:             standards-based tools.
2:32:59 PM:             See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
2:32:59 PM:             ********************************************************************************
2:32:59 PM:     git checkout main
2:32:59 PM:       self.initialize_options()
2:32:59 PM:     running build
2:32:59 PM:     running build_py
2:32:59 PM:     creating build
2:32:59 PM:     creating build/lib.linux-x86_64-cpython-38
2:32:59 PM:     copying re2.py -> build/lib.linux-x86_64-cpython-38
2:32:59 PM:     running build_ext
2:32:59 PM:     building '_re2' extension
2:32:59 PM:     creating build/temp.linux-x86_64-cpython-38
2:32:59 PM:     x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/opt/buildhome/python3.8/lib/python3.8/site-packages/pybind11/include -I/opt/buildhome/python3.8/include -I/usr/include/python3.8 -c _re2.cc -o build/temp.linux-x86_64-cpython-38/_re2.o -fvisibility=hidden
2:32:59 PM:     _re2.cc:13:10: fatal error: absl/strings/string_view.h: No such file or directory
2:32:59 PM:        13 | #include absl/strings/string_view.h
2:32:59 PM:           |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2:32:59 PM:     compilation terminated.
2:32:59 PM:     error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
2:32:59 PM:     ----------------------------------------
2:33:00 PM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
2:33:00 PM: ERROR: Command errored out with exit status 1: /opt/buildhome/python3.8/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"/tmp/pip-install-ti3twlby/google-re2/setup.py"'; __file__='"/tmp/pip-install-ti3twlby/google-re2/setup.py"';f=getattr(tokenize, '"open"', open)(__file__);code=f.read().replace('"rn"', '"n"');f.close();exec(compile(code, __file__, '"exec"'))' install --record /tmp/pip-record-8yg4w9lc/install-record.txt --single-version-externally-managed --compile --install-headers /opt/buildhome/python3.8/include/site/python3.8/google-re2 Check the logs for full command output.
```

As seen in:

https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/663395dcce3dc1000843d9fd

During the Cosmos release 1.4.0:
astronomer#934
arojasb3 pushed a commit to arojasb3/astronomer-cosmos that referenced this pull request Jul 14, 2024
Features

* Add dbt docs natively in Airflow via plugin by @dwreeves in astronomer#737
* Add support for ``InvocationMode.DBT_RUNNER`` for local execution mode
by @jbandoro in astronomer#850
* Support partial parsing to render DAGs faster when using
``ExecutionMode.LOCAL``, ``ExecutionMode.VIRTUALENV`` and
``LoadMode.DBT_LS`` by @dwreeves in astronomer#800
* Improve performance by 22-35% or more by caching partial parse
artefact by @tatiana in astronomer#904
* Add Azure Container Instance as Execution Mode by @danielvdende in
astronomer#771
* Add dbt build operators by @dylanharper-qz in astronomer#795
* Add dbt profile config variables to mapped profile by @ykuc in astronomer#794
* Add more template fields to ``DbtBaseOperator`` by @dwreeves in astronomer#786
* Add ``pip_install_options`` argument to operators by @octiva in astronomer#808

Bug fixes

* Make ``PostgresUserPasswordProfileMapping`` schema argument optional
by @FouziaTariq in astronomer#683
* Fix ``folder_dir`` not showing on logs for ``DbtDocsS3LocalOperator``
by @PrimOox in astronomer#856
* Improve ``dbt ls`` parsing resilience to missing tags/config by
@tatiana in astronomer#859
* Fix ``operator_args`` modified in place in Airflow converter by
@jbandoro in astronomer#835
* Fix Docker and Kubernetes operators execute method resolution by
@jbandoro in astronomer#849
* Fix ``TrinoBaseProfileMapping`` required parameter for non method
authentication by @AlexandrKhabarov in astronomer#921
* Fix global flags for lists by @ms32035 in astronomer#863
* Fix ``GoogleCloudServiceAccountDictProfileMapping`` when getting
values from the Airflow connection ``extra__`` keys by @glebkrapivin in
astronomer#923
* Fix using the dag as a keyword argument as ``specific_args_keys`` in
DbtTaskGroup by @tboutaour in astronomer#916
* Fix ACI integration (``DbtAzureContainerInstanceBaseOperator``) by
@danielvdende in astronomer#872
* Fix setting dbt project dir to the tmp dir by @dwreeves in astronomer#873
* Fix dbt docs operator to not use ``graph.gpickle`` file when
``--no-write-json`` is passed by @dwreeves in astronomer#883
* Make Pydantic a required dependency by @pankajkoti in astronomer#939
* Gracefully error if users try to ``emit_datasets`` with ``Airflow
2.9.0`` or ``2.9.1`` by @tatiana in astronomer#948
* Fix parsing tests that have no parents in astronomer#933 by @jlaneve
* Correct ``root_path`` in partial parse cache by @pankajkoti in astronomer#950

Docs

* Fix docs homepage link by @jlaneve in astronomer#860
* Fix docs ``ExecutionConfig.dbt_project_path`` by @jbandoro in astronomer#847
* Fix typo in MWAA getting started guide by @jlaneve in astronomer#846
* Fix typo related to exporting docs to GCS by @tboutaour in astronomer#922
* Improve partial parsing docs by @tatiana in astronomer#898
* Improve docs for datasets for airflow >= 2.4 by @SiddiqueAhmad in astronomer#879
* Improve test behaviour docs to highlight ``warning`` feature in the
``virtualenv`` mode by @mc51 in astronomer#910
* Fix docs typo by @SiddiqueAhmad in astronomer#917
* Improve Astro docs by @RNHTTR in astronomer#951

Others

* Add performance integration tests by @jlaneve in astronomer#827
* Enable ``append_env`` in ``operator_args`` by default by @tatiana in
astronomer#899
* Change default ``append_env`` behaviour depending on Cosmos
``ExecutionMode`` by @pankajkoti and @pankajastro in astronomer#954
* Expose the ``dbt`` graph in the ``DbtToAirflowConverter`` class by
@tommyjxl in astronomer#886
* Improve dbt docs plugin rendering padding by @dwreeves in astronomer#876
* Add ``connect_retries`` to databricks profile to fix expensive
integration failures by @jbandoro in astronomer#826
* Add import sorting (isort) to Cosmos by @jbandoro in astronomer#866
* Add Python 3.11 to CI/tests by @tatiana and @jbandoro in astronomer#821, astronomer#824
and astronomer#825
* Fix failing ``test_created_pod`` for
``apache-airflow-providers-cncf-kubernetes`` after v8.0.0 update by
@jbandoro in astronomer#854
* Extend ``DatabricksTokenProfileMapping`` test to include session
properties by @tatiana in astronomer#858
* Fix broken integration test uncovered from Pytest 8.0 update by
@jbandoro in astronomer#845
* Add Apache Airflow 2.9 to the test matrix by @tatiana in astronomer#940
* Replace deprecated ``DummyOperator`` by ``EmptyOperator`` if Airflow
>=2.4.0 by @tatiana in astronomer#900
* Improve logs to troubleshoot issue in 1.4.0a2 with astro-cli by
@tatiana in astronomer#947
* Fix issue when publishing a new release to PyPI by @tatiana in astronomer#946
* Pre-commit hook updates in astronomer#820, astronomer#834, astronomer#843 and astronomer#852, astronomer#890, astronomer#896,
astronomer#901, astronomer#905, astronomer#908, astronomer#919, astronomer#931, astronomer#941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dependencies Related to dependencies, like Python packages, library versions, etc area:docs Relating to documentation, changes, fixes, improvement area:execution Related to the execution environment/mode, like Docker, Kubernetes, Local, VirtualEnv, etc area:parsing Related to parsing DAG/DBT improvement, issues, or fixes area:performance Related to performance, like memory usage, CPU usage, speed, etc dbt:build Primarily related to dbt build command or functionality dbt:docs Primarily related to dbt docs command or functionality lgtm This PR has been approved by a maintainer profile:databricks Related to Databricks ProfileConfig profile:postgres Related to Postgres ProfileConfig profile:trino Related to Trino ProfileConfig size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants