Skip to main content

Astronomer Nova

(Formerly Airflow V2 Upgrader)

This project aims to automate common tasks when upgrading DAGs from Airflow 1 to Airflow 2, making use of RedBaron to parse and manipulate the Python syntax tree.

Features

  • Automatically upgrade DAG source code from Airflow 1 to Airflow 2
  • Scan Dags and report changes (Coming Soon)

Installation

You can install the Astronomer Nova CLI through Pip

pip install astronomer-nova

The simplest way to get started with Astronomer Nova is by using the astro cli. Simply add astronomer-nova to your list of dependencies in requirements.txt. Then you can run it with the following commands:

astro dev start
astro dev bash
nova

Installation from sources

To install astronomer-nova in development mode:

pip install --editable .[lint,test]

To build from sources:

python -m build

OR

python -m pip wheel .

Running tests:

python -m pytest

How to Use

nova dags/ dags/upgraded/

For more information, you can access the help menu with:

nova --help

How it works

Astronomer Nova performs the upgrade by:

  1. Building an import map for classes in airflow.hooks, airflow.operators, airflow.sensors, and airflow.providers, which maps the classes to the current Airflow version import path.
  2. Modifying Python files in a DAG directory to update
    • Imports
    • DAG access controls
    • XCOM push
    • XCOM pull
  3. Writing updated DAG to either the same DAG directory or a parameter output directory with _upgraded added to the filename.

The script is configured to run against ./dags and to write output to ./dags/upgraded by default.

Caveats

In order to load the Airflow import map, Airflow provider packages must be installed. There are often cross-dependencies within Airflow providers (eg airflow.operators.s3_to_hive_operator required the Hive provider), so make sure the requirements.txt file includes all necessary .

The script currently tries to correct imports that do not need to be changed going from Airflow 1 to 2, and logging does not include which files are currently being acted against.

The code uses Astronomer-centric opinions, like removing DAG-level RBAC. In the future, I'd rather have these decisions configurable at runtime, as well as generating per-DAG reports on the DAGs that can be used for further remediation, as well as understanding of DAG requirements, like the use of Connections and Variables.

Contribute

Contact

cabella@astronomer.io

Metadata

Release files for astronomer-nova 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astronomer-nova 0.1.3
File Size Uploaded Provenance
astronomer-nova-0.1.3.tar.gz 6.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for astronomer-nova 0.1.3
File Interpreter ABI Platform
astronomer_nova-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / astronomer-nova-0.1.3.tar.gz

Download URL astronomer-nova-0.1.3.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9cccc325e4908c120e6c31be5665dcfbf428d1cf23aff42eb1c8312251bcf731
BLAKE2b-256 checksum
How to use checksums
5ff3347fd147db739f9da1769d4f5d0e4c10e40cee1dad598a6960c5dccd2161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / astronomer_nova-0.1.3-py3-none-any.whl

Download URL astronomer_nova-0.1.3-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cb8f2cdd7db4df3962f25c868c61a649ea3cdeaaf7351ef193a81a3f804a135
BLAKE2b-256 checksum
How to use checksums
bf3a8f85b63abf63c917f10780bf03a02ae738d7fa1171dabadfbfd143d28f8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Security for astronomer-nova 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page