Skip to content

Commit

Permalink
feat: Support validating configuration for any tap with a dynamic cat…
Browse files Browse the repository at this point in the history
…alog
  • Loading branch information
edgarrmondragon committed Sep 2, 2022
1 parent b5af06a commit be8e0eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions samples/sample_tap_sqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class SQLiteTap(SQLTap):
DB_PATH_CONFIG,
th.StringType,
description="The path to your SQLite database file(s).",
required=True,
)
).to_dict()

Expand Down
1 change: 1 addition & 0 deletions samples/sample_target_sqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class SQLiteTarget(SQLTarget):
DB_PATH_CONFIG,
th.StringType,
description="The path to your SQLite database file(s).",
required=True,
)
).to_dict()

Expand Down
7 changes: 6 additions & 1 deletion singer_sdk/tap_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class Tap(PluginBase, metaclass=abc.ABCMeta):
plugins.
"""

dynamic_catalog: bool = False
"""Whether the tap's catalog is dynamic. Set to True if the catalog is
generated dynamically (e.g. by querying a database's system tables)."""

# Constructor

def __init__(
Expand Down Expand Up @@ -435,7 +439,7 @@ def cb_discover(
tap = cls(
config=config_files,
parse_env_config=parse_env_config,
validate_config=False,
validate_config=cls.dynamic_catalog,
)
tap.run_discovery()
ctx.exit()
Expand Down Expand Up @@ -524,6 +528,7 @@ class SQLTap(Tap):

# Stream class used to initialize new SQL streams from their catalog declarations.
default_stream_class: Type[SQLStream]
dynamic_catalog: bool = True

def __init__(
self,
Expand Down

0 comments on commit be8e0eb

Please sign in to comment.