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

Use Airflow constraint file for test environment setup #812

Merged

Conversation

jbandoro
Copy link
Collaborator

Description

This PR installs apache-airflow in the hatch pre-install-commands section so Airflow related dependency conflicts do not need to be managed in the override section that has been removed.

Installing from the Airflow constraint file for versions <=2.6 fails because PyYAML is pinned in the constraint file for those versions to 6.0.0 and a workaround is required becaused older versions of PyYAML can no longer be installed from unmodified source or sdist with the release of Cython3.

Related Issue(s)

closes #811

Breaking Change?

None

Checklist

  • I have made corresponding changes to the documentation (if required)
  • I have added tests that prove my fix is effective or that my feature works

Copy link

netlify bot commented Jan 23, 2024

Deploy Preview for sunny-pastelito-5ecb04 canceled.

Name Link
🔨 Latest commit 2855bba
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/65b435df0978d60008756182

@jbandoro jbandoro marked this pull request as ready for review January 23, 2024 23:18
@jbandoro jbandoro requested a review from a team as a code owner January 23, 2024 23:18
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. area:dependencies Related to dependencies, like Python packages, library versions, etc execution:virtualenv Related to Virtualenv execution environment labels Jan 23, 2024
@jbandoro
Copy link
Collaborator Author

@tatiana do you know how to get the Github actions to run with the updated matrix made to the .github/workflows/test.yml in this PR - it seems to be running the workflow file from the main branch.

Copy link
Collaborator

@tatiana tatiana left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, @jbandoro! This part of the configuration can really use some tidying up.

I left some comments inline.

To validate the changes of this branch before merging to main, you could try to add something like:

on:
  push:
    branches: [<BRANCH_NAME>]

To: https://github.com/astronomer/astronomer-cosmos/blob/main/.github/workflows/test.yml#L3

It may be easier if the PR is made from the main Github repo, but there must be a way to set it up pointing to a fork branch as well.

.github/workflows/test.yml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@jbandoro jbandoro added this to the 1.3.2 milestone Jan 24, 2024
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9c090a4) 94.76% compared to head (3c9281f) 94.77%.
Report is 4 commits behind head on main.

❗ Current head 3c9281f differs from pull request most recent head 2855bba. Consider uploading reports for the commit 2855bba to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #812   +/-   ##
=======================================
  Coverage   94.76%   94.77%           
=======================================
  Files          55       55           
  Lines        2447     2450    +3     
=======================================
+ Hits         2319     2322    +3     
  Misses        128      128           

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

Copy link
Collaborator

@tatiana tatiana left a comment

Choose a reason for hiding this comment

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

Much more maintainable, thanks a lot, @jbandoro !

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 26, 2024
@tatiana tatiana merged commit 928ba83 into astronomer:main Jan 26, 2024
39 checks passed
tatiana pushed a commit that referenced this pull request Jan 26, 2024
This PR installs apache-airflow in the hatch `pre-install-commands`
section so Airflow related dependency conflicts do not need to be
managed in the override section that has been removed.

Installing from the Airflow constraint file for versions <=2.6 fails
because PyYAML is pinned in the constraint file for those versions to
6.0.0 and [a workaround ](yaml/pyyaml#736) is
required becaused older versions of PyYAML can no longer be installed
from unmodified source or sdist with the release of Cython3.

Closes: #811
(cherry picked from commit 928ba83)
tatiana added a commit that referenced this pull request Jan 26, 2024
Bug fixes

* Fix: ensure DbtGraph.update_node_dependency is called for all load methods by @jbandoro in #803
* Fix: ensure operator execute method is consistent across all execution base subclasses by @jbandoro in #805
* Fix custom selector when test node has no depends_on values by @tatiana in #814
* Fix forwarding selectors to test task when using TestBehavior.AFTER_ALL (#816)

Others

* Docs: Remove incorrect docstring from DbtLocalBaseOperator by @jakob-hvitnov-telia in #797
* Add more logs to troubleshoot custom selector by @tatiana in #809
* Fix OpenLineage integration documentation by @tatiana in #810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and @tatiana in #806
* Use Airflow constraint file for test environment setup by @jbandoro in #812
* pre-commit updates in #799, #807
tatiana added a commit that referenced this pull request Jan 26, 2024
Bug fixes

* Fix: ensure DbtGraph.update_node_dependency is called for all load methods by @jbandoro in #803
* Fix: ensure operator execute method is consistent across all execution base subclasses by @jbandoro in #805
* Fix custom selector when test node has no depends_on values by @tatiana in #814
* Fix forwarding selectors to test task when using TestBehavior.AFTER_ALL (#816)

Others

* Docs: Remove incorrect docstring from DbtLocalBaseOperator by @jakob-hvitnov-telia in #797
* Add more logs to troubleshoot custom selector by @tatiana in #809
* Fix OpenLineage integration documentation by @tatiana in #810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and @tatiana in #806
* Use Airflow constraint file for test environment setup by @jbandoro in #812
* pre-commit updates in #799, #807
tatiana added a commit that referenced this pull request Jan 26, 2024
Bug fixes

* Fix: ensure DbtGraph.update_node_dependency is called for all load methods by @jbandoro in #803
* Fix: ensure operator execute method is consistent across all execution base subclasses by @jbandoro in #805
* Fix custom selector when test node has no depends_on values by @tatiana in #814
* Fix forwarding selectors to test task when using TestBehavior.AFTER_ALL by @tatiana in #816

Others

* Docs: Remove incorrect docstring from DbtLocalBaseOperator by @jakob-hvitnov-telia in #797
* Add more logs to troubleshoot custom selector by @tatiana in #809
* Fix OpenLineage integration documentation by @tatiana in #810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and @tatiana in #806
* Use Airflow constraint file for test environment setup by @jbandoro in #812
* pre-commit updates in #799, #807
@tatiana tatiana mentioned this pull request Jan 26, 2024
tatiana added a commit that referenced this pull request Jan 26, 2024
**Bug fixes**

* Fix: ensure ``DbtGraph.update_node_dependency`` is called for all load
methods by @jbandoro in #803
* Fix: ensure operator ``execute`` method is consistent across all
execution base subclasses by @jbandoro in #805
* Fix custom selector when ``test`` node has no ``depends_on`` values by
@tatiana in #814
* Fix forwarding selectors to test task when using
``TestBehavior.AFTER_ALL`` by @tatiana in #816

**Others**

* Docs: Remove incorrect docstring from ``DbtLocalBaseOperator`` by
@jakob-hvitnov-telia in #797
* Add more logs to troubleshoot custom selector by @tatiana in #809
* Fix OpenLineage integration documentation by @tatiana in #810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and
@tatiana in #806
* Use Airflow constraint file for test environment setup by @jbandoro in
#812
* pre-commit updates in #799, #807
tatiana added a commit that referenced this pull request Jan 26, 2024
Bug fixes

* Fix: ensure DbtGraph.update_node_dependency is called for all load methods by @jbandoro in #803
* Fix: ensure operator execute method is consistent across all execution base subclasses by @jbandoro in #805
* Fix custom selector when test node has no depends_on values by @tatiana in #814
* Fix forwarding selectors to test task when using TestBehavior.AFTER_ALL by @tatiana in #816

Others

* Docs: Remove incorrect docstring from DbtLocalBaseOperator by @jakob-hvitnov-telia in #797
* Add more logs to troubleshoot custom selector by @tatiana in #809
* Fix OpenLineage integration documentation by @tatiana in #810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and @tatiana in #806
* Use Airflow constraint file for test environment setup by @jbandoro in #812
* pre-commit updates in #799, #807
@tatiana tatiana mentioned this pull request Jan 27, 2024
tatiana added a commit that referenced this pull request Jan 27, 2024
**Bug fixes**

* Fix: ensure ``DbtGraph.update_node_dependency`` is called for all load
methods by @jbandoro in #803
* Fix: ensure operator ``execute`` method is consistent across all
execution base subclasses by @jbandoro in #805
* Fix custom selector when ``test`` node has no ``depends_on`` values by
@tatiana in #814
* Fix forwarding selectors to test task when using
``TestBehavior.AFTER_ALL`` by @tatiana in #816

**Others**

* Docs: Remove incorrect docstring from ``DbtLocalBaseOperator`` by
@jakob-hvitnov-telia in #797
* Add more logs to troubleshoot custom selector by @tatiana in #809
* Fix OpenLineage integration documentation by @tatiana in #810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and
@tatiana in #806
* Use Airflow constraint file for test environment setup by @jbandoro in
#812
* pre-commit updates in #799, #807

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Justin Bandoro <79104794+jbandoro@users.noreply.github.com>
Co-authored-by: Jakob Aron Hvitnov <141235900+jakob-hvitnov-telia@users.noreply.github.com>
arojasb3 pushed a commit to arojasb3/astronomer-cosmos that referenced this pull request Jul 14, 2024
This PR installs apache-airflow in the hatch `pre-install-commands`
section so Airflow related dependency conflicts do not need to be
managed in the override section that has been removed.

Installing from the Airflow constraint file for versions <=2.6 fails
because PyYAML is pinned in the constraint file for those versions to
6.0.0 and [a workaround ](yaml/pyyaml#736) is
required becaused older versions of PyYAML can no longer be installed
from unmodified source or sdist with the release of Cython3.

Closes: astronomer#811
arojasb3 pushed a commit to arojasb3/astronomer-cosmos that referenced this pull request Jul 14, 2024
**Bug fixes**

* Fix: ensure ``DbtGraph.update_node_dependency`` is called for all load
methods by @jbandoro in astronomer#803
* Fix: ensure operator ``execute`` method is consistent across all
execution base subclasses by @jbandoro in astronomer#805
* Fix custom selector when ``test`` node has no ``depends_on`` values by
@tatiana in astronomer#814
* Fix forwarding selectors to test task when using
``TestBehavior.AFTER_ALL`` by @tatiana in astronomer#816

**Others**

* Docs: Remove incorrect docstring from ``DbtLocalBaseOperator`` by
@jakob-hvitnov-telia in astronomer#797
* Add more logs to troubleshoot custom selector by @tatiana in astronomer#809
* Fix OpenLineage integration documentation by @tatiana in astronomer#810
* Fix test dependencies after Airflow 2.8 release by @jbandoro and
@tatiana in astronomer#806
* Use Airflow constraint file for test environment setup by @jbandoro in
astronomer#812
* pre-commit updates in astronomer#799, astronomer#807

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Justin Bandoro <79104794+jbandoro@users.noreply.github.com>
Co-authored-by: Jakob Aron Hvitnov <141235900+jakob-hvitnov-telia@users.noreply.github.com>
@tatiana tatiana mentioned this pull request Aug 27, 2024
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 execution:virtualenv Related to Virtualenv execution environment lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Cosmos test environment Airflow installation
2 participants