Skip to content

Filesystem: Improve parameter validation/selection for write-disposition strategy (--incremental-strategy, --full-refresh) #188

Description

@coderabbitai

Summary

Track a proposal to improve how strategy-selection parameters (e.g. --incremental-strategy, --full-refresh) are validated and honoured for filesystem-family sources (local, s3, gcs, sftp), as raised in #137.

Background

From the discussion in #137 (comment by @hampsterx):

Because filesystem sources override incremental_strategy to none, an explicit --incremental-strategy flag is currently swallowed: append becomes a no-op and replace is unreachable through that flag (only --full-refresh can reset the destination). Two complications noted:

  1. replace is also the current default strategy value, and the run only sees the resolved value, not whether the flag was explicitly passed. So "keep append as the default but honour an explicit replace" requires a was-provided sentinel; simply dropping the override would flip these sources to replace-by-default unintentionally.
  2. Any fix must be scoped to the filesystem family (or gated on a source capability), since several handled SaaS/streaming sources set their own resource-level merge/replace dispositions, and a run-level disposition would override those.

@amotl additionally suggested considering a broader channelling/validation layer for such parameters based on pydantic, potentially across all pipeline elements, as a longer-term direction (kept here as context, not a hard requirement).

Task

  • Design a mechanism to detect whether --incremental-strategy was explicitly provided by the user (vs. defaulted), scoped to filesystem sources.
  • Honour an explicit replace/append value from --incremental-strategy for filesystem sources without breaking the append-by-default behaviour.
  • Ensure the fix does not affect other sources that set their own resource-level merge/replace dispositions.
  • Optionally evaluate introducing pydantic-based validation for pipeline parameters as a longer-term follow-up.

Acceptance criteria

  • Explicit --incremental-strategy replace (or append) works as expected for filesystem sources.
  • Default behaviour (append on re-run, --full-refresh for reset) is preserved when the flag is not passed.
  • No regression for non-filesystem sources with resource-level dispositions.

References

Requested by: @amotl

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinementSmall steps for enhanced robustness and details done right.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions