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

Support persisting the LoadMode.VIRTUALENV directory #1079

Merged
merged 55 commits into from
Aug 16, 2024

Commits on Jul 29, 2024

  1. Configuration menu
    Copy the full SHA
    cdc2582 View commit details
    Browse the repository at this point in the history
  2. Add basic test

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    a2e4022 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6ac0225 View commit details
    Browse the repository at this point in the history
  4. Only accept Path(...)

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    bf3d1f1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5715d16 View commit details
    Browse the repository at this point in the history
  6. Assert warning

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    4971c4e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    522e7ac View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    905f602 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ef245ba View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2fcc707 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0a58f34 View commit details
    Browse the repository at this point in the history
  12. Add a validation decorator

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    55f785e View commit details
    Browse the repository at this point in the history
  13. Mock + rebase

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    cd47ddc View commit details
    Browse the repository at this point in the history
  14. Support ProjectConfig.dbt_project_path = None & different paths for…

    … Rendering and Execution (#634)
    
    This MR finishes the work that was started in #605 to add full support
    for ProjectConfig.dbt_project_path = None, and implements #568.
    
    Within this PR, several things have been updated:
    1 - Added project_path fields to RenderConfig and ExecutionConfig
    2 - Simplified the consumption of RenderConfig in the dbtGraph class
    3 - added option to configure different dbt executables for Rendering vs
    Execution.
    
    Closes: #568
    MrBones757 authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    ad54b59 View commit details
    Browse the repository at this point in the history
  15. Fix rebase conflicts

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    8e86ce2 View commit details
    Browse the repository at this point in the history
  16. Fix reusing config accross TaskGroups/DAGs (#664)

    If execution_config was reused, Cosmos 1.2.2 would raise:
    
    ```
    astronomer-cosmos/dags/basic_cosmos_task_group.py
    Traceback (most recent call last):
      File "/Users/tati/Code/cosmos-clean/astronomer-cosmos/venv-38/lib/python3.8/site-packages/airflow/models/dagbag.py", line 343, in parse
        loader.exec_module(new_module)
      File "<frozen importlib._bootstrap_external>", line 848, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/Users/tati/Code/cosmos-clean/astronomer-cosmos/dags/basic_cosmos_task_group.py", line 74, in <module>
        basic_cosmos_task_group()
      File "/Users/tati/Code/cosmos-clean/astronomer-cosmos/venv-38/lib/python3.8/site-packages/airflow/models/dag.py", line 3817, in factory
        f(**f_kwargs)
      File "/Users/tati/Code/cosmos-clean/astronomer-cosmos/dags/basic_cosmos_task_group.py", line 54, in basic_cosmos_task_group
        orders = DbtTaskGroup(
      File "/Users/tati/Code/cosmos-clean/astronomer-cosmos/cosmos/airflow/task_group.py", line 26, in __init__
        DbtToAirflowConverter.__init__(self, *args, **specific_kwargs(**kwargs))
      File "/Users/tati/Code/cosmos-clean/astronomer-cosmos/cosmos/converter.py", line 113, in __init__
        raise CosmosValueError(
    cosmos.exceptions.CosmosValueError: ProjectConfig.dbt_project_path is mutually exclusive with RenderConfig.dbt_project_path and ExecutionConfig.dbt_project_path.If using RenderConfig.dbt_project_path or ExecutionConfig.dbt_project_path, ProjectConfig.dbt_project_path should be None
    ```
    
    This has been raised by an Astro customer and our field engineer, who
    tried to run: https://github.com/astronomer/cosmos-demo
    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    e384177 View commit details
    Browse the repository at this point in the history
  17. Iron out locking flow

    LennartKloppenburg authored and tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    d0eeae0 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    bebe6d4 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    801a6dc View commit details
    Browse the repository at this point in the history
  20. Fix tests in main

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    521ce5a View commit details
    Browse the repository at this point in the history
  21. Fix tests

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    bd5aa76 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    376616b View commit details
    Browse the repository at this point in the history
  23. Fix pre-commit hook check

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    738ee73 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    610e5a4 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    7aabbf6 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    c33dc5b View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    2949862 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    490855a View commit details
    Browse the repository at this point in the history
  29. Add tests

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    551fd28 View commit details
    Browse the repository at this point in the history
  30. Add tests

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    16b83bb View commit details
    Browse the repository at this point in the history
  31. Add more tests

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    4fe457e View commit details
    Browse the repository at this point in the history
  32. Add more tests

    tatiana committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    4068edc View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    0e17d30 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. Configuration menu
    Copy the full SHA
    d9c7cc4 View commit details
    Browse the repository at this point in the history
  2. ⬆ [pre-commit.ci] pre-commit autoupdate (#1125)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/asottile/pyupgrade: v3.16.0 →
    v3.17.0](asottile/pyupgrade@v3.16.0...v3.17.0)
    - [github.com/astral-sh/ruff-pre-commit: v0.5.4 →
    v0.5.5](astral-sh/ruff-pre-commit@v0.5.4...v0.5.5)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] authored and tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    0042e76 View commit details
    Browse the repository at this point in the history
  3. Fix import handling by lazy loading hooks introduced in PR #1109 (#1132)

    Making an update to #1109, which introduced module-level imports of
    optional dependencies. This is inappropriate as it will break if the
    user does not have them installed, and indeed the user really does not
    need them installed if they are not relying on them directly.
    
    This PR lazy-loads the imports so that it does not impact users who do
    not need them.
    
    In the upath library, `az:`, `adl:`, `abfs:` and `abfss:` are also all valid schemes, 
    albeit Airflow only references the latter 3 in the code: https://github.com/apache/airflow/blob/e3824eaaba7eada9a807f7a2f9f89d977a210e15/airflow/providers/microsoft/azure/fs/adls.py#L29, so `adl:`, `abfs:` and `abfss:` also have been added
    to the list of schemes supported.
    dwreeves authored and tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    63a2bf4 View commit details
    Browse the repository at this point in the history
  4. ⬆ [pre-commit.ci] pre-commit autoupdate (#1144)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/astral-sh/ruff-pre-commit: v0.5.5 →
    v0.5.6](astral-sh/ruff-pre-commit@v0.5.5...v0.5.6)
    - [github.com/psf/black: 24.4.2 →
    24.8.0](psf/black@24.4.2...24.8.0)
    - [github.com/pre-commit/mirrors-mypy: v1.11.0 →
    v1.11.1](pre-commit/mirrors-mypy@v1.11.0...v1.11.1)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] authored and tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    31041fe View commit details
    Browse the repository at this point in the history
  5. Cache package-lock.yml file (#1086)

    This PR aims to cache the package-lock.yml in `cache_dir/dbt_project`
    
    Since dbt version 1.7.0, executing the dbt deps command results in the
    generation of a package-lock.yml file. This file pins the dependencies
    and their versions for the dbt project. dbt uses this file to install
    packages, ensuring predictable and consistent package installations
    across environments.
    
    - This feature is enabled only if the user checks in package-lock.yml in
    their dbt project. Also, I'm assuming if `package-lock.yml` their
    dbt-core version is >= 1.7.0 since this feature is available for only
    dbt >= 1.7.0
    - package-lock.yml also contains the sha1_hash of the packages. This is
    used to check if the cached package-lock.yml is outdated or not in this
    PR
    - The cached `package-lock.yml` is finally copied from from cached path
    to the tmp project and used
    - To update dependencies or versions, it is expected that the user will
    manually update their package-lock.yml in the dbt project using the dbt
    deps command.
    
    
    closes: #930
    pankajastro authored and tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    0f0d93a View commit details
    Browse the repository at this point in the history
  6. ⬆ [pre-commit.ci] pre-commit autoupdate (#1154)

    <!--pre-commit.ci start-->
    updates:
    - [github.com/astral-sh/ruff-pre-commit: v0.5.6 →
    v0.5.7](astral-sh/ruff-pre-commit@v0.5.6...v0.5.7)
    <!--pre-commit.ci end-->
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] authored and tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    f333714 View commit details
    Browse the repository at this point in the history
  7. Add default source nodes rendering (#1107)

    Re-Opening of PR #661
    
    This PR features a new way of rendering source nodes:
    - Check freshness for sources with freshness checks
    - Source tests
    - Empty operators for nodes without tests or freshness.
    
    One of the main limitations I found while using the `custom_callback`
    functions on source nodes to check freshness is that nodes were being
    created on 100% of sources but not all of them required freshness
    checks, this made workers waste compute time.
    
    I'm adding a new variable into the DbtNode class called has_freshness
    which would be True for sources with freshness checks and False for any
    other resource type.
    
    If this feature is enabled with the option `ALL`:
    All sources with the has_freshness == False will be rendered as Empty
    Operators, to keep the dbt's behavior of showing sources as suggested in
    issue #630
    <!-- Add a brief but complete description of the change. -->
    
    A new rendered template field is included too: `freshness` which is the
    sources.json generated by dbt when running `dbt source freshness`
    
    This adds a new node type (source), which changes some tests behavior.
    This PR also updates the dev dbt project jaffle_shop to include source
    nodes when enabled.
    
    ![image](https://github.com/user-attachments/assets/e972ac58-8741-4c13-9905-e78775f9cc80)
    
    As seen in the image, source nodes with freshness checks are rendered
    with a blue color, while the ones rendered as EmptyOperator show a
    white/light green color
    
    Closes: #630
    Closes: #572
    Closes: #875
    <!-- If this PR closes an issue, you can use a keyword to auto-close.
    -->
    <!-- i.e. "closes #0000" -->
    
    This won't be a breaking change since the default behavior will still be
    ignoring this new feature. That can be changed with the new RenderConfig
    variable called `source_rendering_behavior`.
    
    Co-authored-by: Pankaj <[email protected]>
    Co-authored-by: Pankaj Singh <[email protected]>
    3 people authored and tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    f1a1273 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eb983d6 View commit details
    Browse the repository at this point in the history
  9. Blackfy

    tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    5da4395 View commit details
    Browse the repository at this point in the history
  10. Fix broken test

    tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    7d0c31a View commit details
    Browse the repository at this point in the history
  11. Fix broken test

    tatiana committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    31bbd19 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Configuration menu
    Copy the full SHA
    8621e49 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c48f1ca View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. Fix unittests

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    0f7fcf4 View commit details
    Browse the repository at this point in the history
  2. Add docs

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    a712c27 View commit details
    Browse the repository at this point in the history
  3. Address PR feedback

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    43cb07d View commit details
    Browse the repository at this point in the history
  4. Address PR feedback

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    b465b2a View commit details
    Browse the repository at this point in the history
  5. Fix unittest mock

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    bf35988 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    41fe21c View commit details
    Browse the repository at this point in the history
  7. Improve comments

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    b6813af View commit details
    Browse the repository at this point in the history
  8. Fix issue after rebase

    tatiana committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    0ff5c7a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f4d0c3a View commit details
    Browse the repository at this point in the history