I've started developing a tap called `tap-growthbo...
# singer-tap-development
h
I've started developing a tap called
tap-growthbook
using the Meltano SDK. When testing without meltano it runs fine, but then when I invoke with
meltano run
via
uv run
I get a discovery related error, and I don't know how to debug it. Here's the error:
1
e
Can you run
meltano invoke tap-growthbook --discover > catalog.json
and inspect the resulting file? We're looking for a line that might throw off the JSON parser.
h
Yes it's producing this odd double object at the top of the file:
Copy code
{'$schema': '<http://json-schema.org/schema#>', 'type': 'object', 'properties': {'id': {'type': 'string', 'description': 'Unique identifier for the experiment'}, 'name': {'type': 'string', 'description': 'Name of the experiment'}}}
{'$schema': '<http://json-schema.org/schema#>', 'type': 'object', 'properties': {'id': {'type': 'string', 'description': 'Unique identifier for the experiment'}, 'name': {'type': 'string', 'description': 'Name of the experiment'}}}
{
  "streams":[
    {
      "tap_stream_id":"experiments",
      "replication_method":"FULL_TABLE",
      "key_properties":[
        "id"
      ],
      "schema":{
        "properties":{
          "id":{
            "description":"Unique identifier for the experiment",
            "type":"string"
          },
          "name":{
            "description":"Name of the experiment",
            "type":"string"
          }
        },
        "type":"object",
        "$schema":"<http://json-schema.org/schema#>"
      },
      "stream":"experiments",
      "metadata":[
        {
          "breadcrumb":[
            "properties",
            "id"
          ],
          "metadata":{
            "inclusion":"automatic"
          }
        },
        {
          "breadcrumb":[
            "properties",
            "name"
          ],
          "metadata":{
            "inclusion":"available"
          }
        },
        {
          "breadcrumb":[],
          "metadata":{
            "inclusion":"available",
            "selected":true,
            "selected-by-default":true,
            "table-key-properties":[
              "id"
            ]
          }
        }
      ]
    }
  ]
}
OK there were a couple of issues with my Tap's implementation, but the one that seemed to fix the issue was removing this
__init__
Copy code
def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self._schema: Optional[Dict[str, Any]] = None
and implementing the
schema_filepath
rather than
schema
property. Price I pay for depending on AI generated code.
😅 1
e
Glad you figured it out!