dagster icon indicating copy to clipboard operation
dagster copied to clipboard

POC: Model management using code generation

Open schrockn opened this issue 9 months ago • 2 comments

Summary & Motivation

How I Tested These Changes

(dagster-internal.3.11.5-2024-04-26) ➜  models git:(codegen-models) ✗ python generate.py

from typing import NamedTuple

from dagster import _check as check


class ExampleDataClass(
    NamedTuple("ExampleDataClass", [
        ("int_value", int),
        ("str_value", str),
    ],
):
    int_value: int
    str_value: str

    def __new__(
        cls,
        *
        int_value: int,
        str_value: str,
    ) -> "ExampleDataClass":
        return super().__new__(
            cls,
            check.int_param(int_value, "int_value"),
            check.str_param(str_value, "str_value"),
        )

schrockn avatar May 14 '24 16:05 schrockn