Skip to content

Commit 93bbe08

Browse files
refactor: Use a single source of truth for built-in capabilities
1 parent 4674b3f commit 93bbe08

19 files changed

+709
-523
lines changed

docs/builtin.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Built-in Settings and Capabilities
2+
==================================
3+
4+
.. currentmodule:: singer_sdk.helpers.capabilities
5+
6+
The Singer SDK library provides a number of built-in settings and capabilities.
7+
8+
.. autodata:: ADD_RECORD_METADATA
9+
:no-value:
10+
11+
.. autoattribute:: ADD_RECORD_METADATA.schema
12+
13+
.. autodata:: BATCH
14+
:no-value:
15+
16+
.. autoattribute:: BATCH.schema
17+
.. autoattribute:: BATCH.capability

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ within the `#singer-tap-development`_ and `#singer-target-development`_ Slack ch
5757
implementation/index
5858
typing
5959
capabilities
60+
builtin
6061

6162
.. toctree::
6263
:caption: Advanced Concepts

singer_sdk/connectors/sql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from singer_sdk import typing as th
1818
from singer_sdk._singerlib import CatalogEntry, MetadataMapping, Schema
1919
from singer_sdk.exceptions import ConfigValidationError
20-
from singer_sdk.helpers.capabilities import TargetLoadMethods
20+
from singer_sdk.helpers import capabilities
2121

2222
if t.TYPE_CHECKING:
2323
from sqlalchemy.engine import Engine
@@ -779,7 +779,7 @@ def prepare_table(
779779
as_temp_table=as_temp_table,
780780
)
781781
return
782-
if self.config["load_method"] == TargetLoadMethods.OVERWRITE:
782+
if self.config["load_method"] == capabilities.TargetLoadMethods.OVERWRITE:
783783
self.get_table(full_table_name=full_table_name).drop(self._engine)
784784
self.create_empty_table(
785785
full_table_name=full_table_name,

0 commit comments

Comments
 (0)