Skip to content

Commit

Permalink
Formalize default stream name
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 17, 2024
1 parent e2fa537 commit 6c89741
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions samples/sample_tap_csv/sample_tap_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from samples.sample_tap_csv.client import SDC_META_FILEPATH, CSVStream
from singer_sdk import Tap

DEFAULT_MERGE_STREAM_NAME = "files"


def file_path_to_stream_name(file_path: str) -> str:
"""Convert a file path to a stream name."""
Expand All @@ -26,7 +28,7 @@ class ReadMode(str, enum.Enum):
class SampleTapCSV(Tap):
"""Sample Tap for CSV files."""

name = "sample-tap-countries"
name = "sample-tap-csv"

config_jsonschema = th.PropertiesList(
th.Property(
Expand All @@ -51,7 +53,8 @@ class SampleTapCSV(Tap):
th.Property(
"stream_name",
th.StringType,
required=False,
required=True,
default=DEFAULT_MERGE_STREAM_NAME,
description="Name of the stream to use when `read_mode` is `merge`.",
),
# TODO(edgarmondragon): Other configuration options.
Expand Down Expand Up @@ -96,7 +99,7 @@ def discover_streams(self) -> list:
return [
CSVStream(
tap=self,
name=self.config.get("stream_name", "merged_stream"),
name=self.config["stream_name"],
partitions=contexts,
)
]
Expand Down

0 comments on commit 6c89741

Please sign in to comment.