edward_chen
03/21/2022, 11:21 PMstreams.py and tap.py specifically in the tap template. I read through the "Getting Started" template and the Code Samples on the site but still not really understanding it.
From my understanding is that the schema defined in the streams.py is the JSON that is being sent from the source and tap.py is the target? But then what happens when we load the cookiecutter target template? I thought taps was used for bringing in data from the source and target was used to send data to a target.
For example this is the flow I'm trying to create:
API source (using a tap) -> S3 bucket -> Postgres (I assume using a target?)thomas_briggs
03/22/2022, 1:04 PMaaronsteers
03/22/2022, 8:07 PMtap.py.
• The Stream class(es) handle API-specific functions, such as defining the schema of the stream, primary keys (key properties), and parent-child relationships. These generally live in streams.py (although some developers break off into smaller files) and sometimes one or more abstract base classes will live in client.py.
Does this help?aaronsteers
03/22/2022, 8:08 PMedward_chen
03/22/2022, 8:10 PMclient.py so that makes sense if it's used as more of an abstract layer to organize the code. So if the code is simple enough, you could put the classes in streams.pyedward_chen
03/22/2022, 8:11 PMaaronsteers
03/22/2022, 8:14 PMSo if the code is simple enough, you could put the classes inYep!streams.py
So in my case, I would want a tap that pulls from my API source and a S3 target right? If I'm understanding the Tap/Target relationshipThat's right!
aaronsteers
03/22/2022, 8:15 PMaaronsteers
03/22/2022, 8:17 PMedward_chen
03/22/2022, 9:03 PMedward_chen
03/22/2022, 9:21 PMtap.py for config_jsonschema = PropertiesList(...). What properties are supposed to go there? I understand that in streams.py, it's the schema of the incoming "raw" data.aaronsteers
03/22/2022, 9:51 PMedward_chen
03/22/2022, 11:32 PM{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"severity": {
"type": "string"
},
"dependencies": {
"type": "array"
},
"projects": {
"type": "array"
}
}
}aaronsteers
03/23/2022, 1:39 AMaaronsteers
03/23/2022, 1:45 AMI'm still not 100% sure on what values I would put inIn tap.py, for config_jsonschema, you are defining the config flags for the user. So, if you need auth or a url endpoint, or other settings that the tap will use as control inputs, those would go intofortap.py.config_jsonschema = PropertiesList(...)
config_jsonschema. This is similar in specification with the schema properties of Streams but the function is very different. In the Tap, you are defining config, and in the Stream, you are defining the schema of the stream's data. Does that help? 🙂edward_chen
03/23/2022, 8:48 PMedward_chen
03/23/2022, 8:51 PMconfig_jsonschema = PropertiesList(Property("permissions", StringType))
assuming the API source requires something like {"permissions": "read-only"}?aaronsteers
03/23/2022, 8:51 PMaaronsteers
03/23/2022, 8:52 PMhost, port, user, password, etc.edward_chen
03/23/2022, 8:53 PMaaronsteers
03/23/2022, 8:53 PM