Skip to content

Commit

Permalink
refactor: Fail early if input files to --catalog or --state do no…
Browse files Browse the repository at this point in the history
…t exist (#2788)
  • Loading branch information
edgarrmondragon authored Nov 30, 2024
1 parent 363d4bc commit a553c38
Showing 1 changed file with 13 additions and 4 deletions.
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

0 comments on commit a553c38

Please sign in to comment.