Skip to content

Add Data Source BACKFILL skip support #16

@gnzjgo

Description

@gnzjgo

Summary

The .datasource format supports BACKFILL skip, but the Python SDK does not expose an equivalent option in Data Source resource definitions.

This came up while adapting the Forward docs to show CLI, TypeScript SDK, and Python SDK examples side by side. The BACKFILL skip example can only be documented for .datasource files today.

Current state

A repo/source check found no backfill, skip_backfill, backfill_skip, or BACKFILL support in the Python SDK:

  • DatasourceOptions does not include a backfill-related field.
  • The datasource generator does not emit BACKFILL skip.
  • The datasource parser/migration code does not recognize BACKFILL.
  • A repo-wide search for backfill returned no matches.

Current DatasourceOptions fields are limited to options like schema, description, engine, tokens, shared_with, json_paths, forward_query, indexes, kafka, s3, and gcs.

Requested behavior

Add SDK support for the .datasource directive:

BACKFILL skip

Suggested API shape, open to whatever fits the SDK conventions:

daily_page_visits = define_datasource("daily_page_visits", {
    "schema": {
        "date": t.date(),
        "page_url": t.string(),
        "visits": t.uint64(),
    },
    "engine": engine.summing_merge_tree({
        "sorting_key": ["date", "page_url"],
    }),
    "backfill": "skip",
})

Expected generated .datasource output should include:

BACKFILL skip

Why

BACKFILL skip is needed to create a new Data Source that is the destination of a Materialized View without backfilling historical data from the Materialized View query. Without SDK support, SDK users cannot represent the same deployment behavior as .datasource users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions