# /// script
# requires-python = ">=3.11"
# dependencies = [
{% for dep in deps %}#     "{{ dep }}",
{% endfor %}
# ]
# ///
"""
Transform: {{ name }}

Generated by: seeknal draft transform {{ name }} --python
"""

from seeknal.pipeline import transform
from seeknal.pipeline.materialization import Materialization, OfflineConfig
from seeknal.tasks.duckdb import DuckDBTask
from seeknal.tasks.duckdb import transformers as T


@transform(
    name="{{ name }}",
    description="{{ description or 'TODO: Add description' }}",
    # inputs=["source.your_source"],  # Uncomment and set upstream dependency
)
def {{ name }}(ctx):
    """
    Transform function receives context with:
    - ctx.ref("kind.name") -> Get upstream DataFrame
    - ctx.duckdb -> DuckDB connection
    - ctx.config -> Profile configuration

    Return the transformed DataFrame.
    """
    # Option 1: Simple SQL via DuckDB
    # df = ctx.ref("source.users")
    # return ctx.duckdb.sql("SELECT * FROM df WHERE active = true").df()

    # Option 2: Builder pattern with transformers
    # df = ctx.ref("source.users")
    # result = (
    #     DuckDBTask()
    #     .add_input(dataframe=df)
    #     .add_stage(transformer=T.SQL("SELECT * FROM __THIS__"))
    #     .transform(ctx.duckdb)
    # )
    # return result

    raise NotImplementedError("TODO: Implement transform logic")
