Skip to content

Commit

Permalink
feat: A warning is now emitted when no streams are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 2, 2024
1 parent edcbb1a commit 734e241
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions singer_sdk/tap_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import abc
import contextlib
import enum
import pathlib
import typing as t
import warnings
from enum import Enum

import click

Expand Down Expand Up @@ -42,7 +42,7 @@
STREAM_MAPS_CONFIG = "stream_maps"


class CliTestOptionValue(Enum):
class CliTestOptionValue(enum.Enum):
"""Values for CLI option --test."""

All = "all"
Expand Down Expand Up @@ -463,6 +463,7 @@ def sync_all(self) -> None:
self.write_message(StateMessage(value=self.state))

stream: Stream
synced_count = 0
for stream in self.streams.values():
if not stream.selected and not stream.has_selected_descendents:
self.logger.info("Skipping deselected stream '%s'.", stream.name)
Expand All @@ -486,6 +487,9 @@ def sync_all(self) -> None:
for stream in self.streams.values():
stream.log_sync_costs()

if not synced_count:
self.logger.warning("No streams selected for sync.")

# Command Line Execution

@classmethod
Expand Down

0 comments on commit 734e241

Please sign in to comment.