Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fail early if input files to --catalog or --state do not exist #2788

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions singer_sdk/tap_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import abc
import contextlib
import pathlib
import typing as t
import warnings
from enum import Enum
Expand Down Expand Up @@ -494,8 +495,8 @@ def invoke( # type: ignore[override]
about: bool = False,
about_format: str | None = None,
config: tuple[str, ...] = (),
state: str | None = None,
catalog: str | None = None,
state: pathlib.Path | None = None,
catalog: pathlib.Path | None = None,
) -> None:
"""Invoke the tap's command line interface.

Expand Down Expand Up @@ -619,12 +620,20 @@ def get_singer_command(cls: type[Tap]) -> click.Command:
click.Option(
["--catalog"],
help="Use a Singer catalog file with the tap.",
type=click.Path(),
type=click.Path(
path_type=pathlib.Path,
exists=True,
dir_okay=False,
),
),
click.Option(
["--state"],
help="Use a bookmarks file for incremental replication.",
type=click.Path(),
type=click.Path(
path_type=pathlib.Path,
exists=True,
dir_okay=False,
),
),
],
)
Expand Down