Skip to content

Rendering options #17

@rory-data

Description

@rory-data

Hi team.

This is more of a question for my own understanding, but why is Blueprint trying to support Python 3.8 and 3.9? With them being end of life (or about to be) and Airflow having dropped support for them, I'm curious.

For context, I've been working through options for how to extend this to have the option for dynamically generating DAG files on build instead of at runtime. Unsure if this is a desired feature for this project, but the factory pattern can make support/debugging more complex. Therefore, my shop has a requirement to be able to see the fully rendered DAG code in the Airflow UI code view, and finding this project seemed fortuitous timing.

There appear to be two options for this:

  1. Store the DAG blueprint as a *.py.j2 file and have that accessible by both render() and a new render_to_file() method, or have the DAG definition that's currently in render() be a Jinja2-compatible text block. Simplest approach but may require more care when developing new blueprints.
  2. Have render() return the DAG object as it does now, but add functionality in core.py to write that out to file. Cleaner on the blueprint side, but much more complex to implement and maintain.

They're both doable, but the lower Python compatibility requirements add more complexity for what may be little gain, thus my original question. Of course, if the rendering to file is not an intended feature, then it's likely a moot point 😄

Cheers
Rory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions