Repository: pola-rs/polars
File: py-polars/src/polars/lazyframe/frame.py (Python)

Code before:
            compression=compression,
            compression_level=compression_level,
            statistics=statistics,
            row_group_size=row_group_size,
            data_page_size=data_page_size,
            metadata=metadata,
            field_overwrites=field_overwrites_dicts,
        )

        if not lazy:
            ldf_py = ldf_py.with_optimizations(optimizations._pyoptflags)
            ldf = LazyFrame._from_pyldf(ldf_py)
            ldf.collect(engine=engine)
            return None
        return LazyFrame._from_pyldf(ldf_py)

    @overload
    def sink_delta(
        self,
        target: str | Path | deltalake.DeltaTable,
        *,
        mode: Literal["error", "append", "overwrite", "ignore"] = ...,
        storage_options: dict[str, str] | None = ...,
        credential_provider: CredentialProviderFunction | Literal["auto"] | None = ...,
        delta_write_options: dict[str, Any] | None = ...,
        engine: EngineType = ...,
        optimizations: QueryOptFlags = ...,
    ) -> None: ...

    @overload
    def sink_delta(
        self,
        target: str | Path | deltalake.DeltaTable,
        *,
        mode: Literal["merge"],
        storage_options: dict[str, str] | None = ...,
        credential_provider: CredentialProviderFunction | Literal["auto"] | None = ...,
        delta_merge_options: dict[str, Any],
        engine: EngineType = ...,
        optimizations: QueryOptFlags = ...,
    ) -> deltalake.table.TableMerger: ...

    @unstable()
    def sink_delta(
        self,
        target: str | Path | deltalake.DeltaTable,
        *,
        mode: Literal["error", "append", "overwrite", "ignore", "merge"] = "error",
        storage_options: dict[str, str] | None = None,
        credential_provider: CredentialProviderFunction
        | Literal["auto"]

Review comment (suggestion):
Could you remove the `engine` parameter, I think it's fine to always use the streaming engine


Code after:
            compression=compression,
            compression_level=compression_level,
            statistics=statistics,
            row_group_size=row_group_size,
            data_page_size=data_page_size,
            metadata=metadata,
            field_overwrites=field_overwrites_dicts,
        )

        if not lazy:
            ldf_py = ldf_py.with_optimizations(optimizations._pyoptflags)
            ldf = LazyFrame._from_pyldf(ldf_py)
            ldf.collect(engine=engine)
            return None
        return LazyFrame._from_pyldf(ldf_py)

    @overload
    def sink_delta(
        self,
        target: str | Path | deltalake.DeltaTable,
        *,
        mode: Literal["error", "append", "overwrite", "ignore"] = ...,
        storage_options: dict[str, str] | None = ...,
        credential_provider: CredentialProviderFunction | Literal["auto"] | None = ...,
        delta_write_options: dict[str, Any] | None = ...,
        optimizations: QueryOptFlags = ...,
    ) -> None: ...

    @overload
    def sink_delta(
        self,
        target: str | Path | deltalake.DeltaTable,
        *,
        mode: Literal["merge"],
        storage_options: dict[str, str] | None = ...,
        credential_provider: CredentialProviderFunction | Literal["auto"] | None = ...,
        delta_merge_options: dict[str, Any],
        optimizations: QueryOptFlags = ...,
    ) -> deltalake.table.TableMerger: ...

    @unstable()
    def sink_delta(
        self,
        target: str | Path | deltalake.DeltaTable,
        *,
        mode: Literal["error", "append", "overwrite", "ignore", "merge"] = "error",
        storage_options: dict[str, str] | None = None,
        credential_provider: CredentialProviderFunction
        | Literal["auto"]
        | None = "auto",
        delta_write_options: dict[str, Any] | None = None,