Skip to content

Commit a89a2bc

Browse files
Add more docs
1 parent cecdc07 commit a89a2bc

File tree

2 files changed

+121
-4
lines changed

2 files changed

+121
-4
lines changed

docs/builtin.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,26 @@ The Singer SDK library provides a number of built-in settings and capabilities.
88
.. autodata:: ADD_RECORD_METADATA
99
:no-value:
1010

11-
.. autoattribute:: ADD_RECORD_METADATA.schema
12-
1311
.. autodata:: BATCH
1412
:no-value:
1513

16-
.. autoattribute:: BATCH.schema
17-
.. autoattribute:: BATCH.capability
14+
.. autodata:: FLATTENING
15+
:no-value:
16+
17+
.. autodata:: STREAM_MAPS
18+
:no-value:
19+
20+
.. autodata:: TARGET_BATCH_SIZE_ROWS
21+
:no-value:
22+
23+
.. autodata:: TARGET_HARD_DELETE
24+
:no-value:
25+
26+
.. autodata:: TARGET_LOAD_METHOD
27+
:no-value:
28+
29+
.. autodata:: TARGET_SCHEMA
30+
:no-value:
31+
32+
.. autodata:: TARGET_VALIDATE_RECORDS
33+
:no-value:

singer_sdk/helpers/capabilities/__init__.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,130 @@
4545

4646
#: For taps, support emitting BATCH messages. For targets, support consuming BATCH
4747
#: messages.
48+
#:
49+
#: Example:
50+
#:
51+
#: .. code-block:: json
52+
#:
53+
#: {
54+
#: "batch_config": {
55+
#: "encoding": {
56+
#: "format": "jsonl",
57+
#: "compression": "gzip"
58+
#: },
59+
#: "storage": {
60+
#: "type": "root",
61+
#: "root": "file:///path/to/batch/files",
62+
#: "prefix": "batch-"
63+
#: }
64+
#: }
65+
#: }
66+
#:
4867
BATCH = Builtin(
4968
schema=schema.BATCH_CONFIG,
5069
capability=PluginCapabilities.BATCH,
5170
)
5271

72+
#: Support schema flattening, aka de-nesting of complex properties.
73+
#:
74+
#: Example:
75+
#:
76+
#: .. code-block:: json
77+
#:
78+
#: {
79+
#: "flattening_enabled": true,
80+
#: "flattening_max_depth": 3
81+
#: }
82+
#:
5383
FLATTENING = Builtin(
5484
schema=schema.FLATTENING_CONFIG,
5585
capability=PluginCapabilities.FLATTENING,
5686
)
87+
88+
#: Support inline stream map transforms.
89+
#:
90+
#: Example:
91+
#:
92+
#: .. code-block:: json
93+
#:
94+
#: {
95+
#: "stream_maps": {
96+
#: "users": {
97+
#: "id": "id",
98+
#: "fields": "[f for f in fields if f['key'] != 'age']"
99+
#: }
100+
#: }
101+
#: }
102+
#:
57103
STREAM_MAPS = Builtin(
58104
schema.STREAM_MAPS_CONFIG,
59105
capability=PluginCapabilities.STREAM_MAPS,
60106
)
107+
108+
#: Target batch size in rows.
109+
#:
110+
#: Example:
111+
#:
112+
#: .. code-block:: json
113+
#:
114+
#: {
115+
#: "batch_size_rows": 10000
116+
#: }
117+
#:
61118
TARGET_BATCH_SIZE_ROWS = Builtin(schema=schema.TARGET_BATCH_SIZE_ROWS_CONFIG)
119+
120+
#: Support hard delete capability.
121+
#:
122+
#: Example:
123+
#:
124+
#: .. code-block:: json
125+
#:
126+
#: {
127+
#: "hard_delete": true
128+
#: }
129+
#:
62130
TARGET_HARD_DELETE = Builtin(
63131
schema=schema.TARGET_HARD_DELETE_CONFIG,
64132
capability=TargetCapabilities.HARD_DELETE,
65133
)
134+
135+
#: Target load method.
136+
#:
137+
#: Example:
138+
#:
139+
#: .. code-block:: json
140+
#:
141+
#: {
142+
#: "load_method": "upsert"
143+
#: }
144+
#:
66145
TARGET_LOAD_METHOD = Builtin(schema=schema.TARGET_LOAD_METHOD_CONFIG)
146+
147+
#: Allow setting the target schema.
148+
#:
149+
#: Example:
150+
#:
151+
#: .. code-block:: json
152+
#:
153+
#: {
154+
#: "default_target_schema": "my_schema"
155+
#: }
156+
#:
67157
TARGET_SCHEMA = Builtin(
68158
schema=schema.TARGET_SCHEMA_CONFIG,
69159
capability=TargetCapabilities.TARGET_SCHEMA,
70160
)
161+
162+
#: Validate incoming records against their declared schema.
163+
#:
164+
#: Example:
165+
#:
166+
#: .. code-block:: json
167+
#:
168+
#: {
169+
#: "validate_records": true
170+
#: }
171+
#:
71172
TARGET_VALIDATE_RECORDS = Builtin(
72173
schema=schema.TARGET_VALIDATE_RECORDS_CONFIG,
73174
capability=TargetCapabilities.VALIDATE_RECORDS,

0 commit comments

Comments
 (0)