I’m having issues with the SDK’s ability to select...
# troubleshooting
a
I’m having issues with the SDK’s ability to select/de-select properties. Unsure if this is a true issue/bug or I’m just missing something. 🧵
Select list looks like this:
Copy code
$ meltano select my-tap --list --all
Selected attributes:
        [selected ] my_tap.keep_field
        [excluded ] my_tap.deselect_field
And the resulting catalog file looks like this:
Copy code
$ meltano invoke --dump=catalog my-tap
...
        {
          "breadcrumb": [],
          "metadata": {
            "inclusion": "available",
            "selected": true
          }
        },        {
          "breadcrumb": [
            "properties",
            "keep_field"
          ],
          "metadata": {
            "inclusion": "available",
            "selected": true
          }
        },
        {
          "breadcrumb": [
            "properties",
            "deselect_field"
          ],
          "metadata": {
            "inclusion": "available",
            "selected": false
          }
        },
...
When running the tap, I see unexpected events in the log and the output includes all fields (instead of selecting just
keep_field
):
Copy code
$ meltano invoke my-tap
...
my-tap | time=2021-05-10 10:42:57 name=my-tap level=WARNING message=Catalog entry missing for 'stream_name':'('properties',)'. Using parent value of selected=True.
my-tap | time=2021-05-10 10:43:03 name=my-tap level=WARNING message=Catalog entry missing for 'stream_name':'('keep_field',)'. Using parent value of selected=True.
my-tap | time=2021-05-10 10:43:03 name=my-tap level=WARNING message=Catalog entry missing for 'stream_name':'('deselect_field',)'. Using parent value of selected=True.
...
I traced this warning in the code, and noticed the breadcrumb didn’t include
properties
in the tuple. I altered https://gitlab.com/meltano/singer-sdk/-/blob/main/singer_sdk/helpers/_catalog.py#L152 to be:
Copy code
property_breadcrumb: Tuple[str, ...] = tuple(list(breadcrumb) + ['properties', property_name])
After this change, running the tap again, it selects as expected. Could this be a bug?
a
@alex_levene - Thanks for logging this. It does look like you’ve uncovered a bug. Do you feel comfortable submitting an issue and/or MR with this finding?
a
Sure, no problem. Will put in the issue later today and will reference here. Thanks!
@aaronsteers I’ve put up a MR for this fix. Let me know if it looks good, thanks! https://gitlab.com/meltano/singer-sdk/-/merge_requests/85
a
Thanks, @alex_levene. I’ll review this today after #C01QS0RV78D. Much appreciated.
a
Hi @aaronsteers, do you have an idea of when you might be able to review this? Not trying to pressure, would just like to get an idea around timing. If there’s a different process for requesting review in GitLab, please let me know. Thanks in advance!