This project is archived. Its data is read-only. This project is read-only.
Deselected properties not popped from record
### What is the current *bug* behavior? When setting `selected=false` either through Meltano or a manual catalog file, the deselected properties are __not__ removed from the tap output. ### What is the expected *correct* behavior? Only automatic or selected properties should be included in the output. ### Steps to reproduce Using the sample [Countries API](https://gitlab.com/meltano/singer-sdk/-/tree/main/singer_sdk/samples/sample_tap_countries) and meltano to reproduce. ``` $ meltano add --custom extractor tap-countries # copy code and schemas from sample folder $ meltano install extractor tap-countriesapi $ meltano select tap-countriesapi countries code $ meltano select tap-countriesapi countries name $ meltano select tap-countriesapi countries currency $ meltano invoke tap-countriesapi ... time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('properties',)'. Using parent value of selected=True. {"type": "SCHEMA", "stream": "countries", "schema": {"properties": {"code": {"type": ["null", "string"]}, "name": {"type": ["null", "string"]}, "currency": {"type": ["null", "string"]}}, "type": "object"}, "key_properties": ["code"]} ... time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('code',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('name',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('native',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('phone',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('continent',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('continent', 'code')'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('continent', 'name')'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('capital',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('currency',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('languages',)'. Using parent value of selected=True. time=2021-05-10 16:54:22 name=sample-tap-countries level=WARNING message=Catalog entry missing for 'countries':'('emoji',)'. Using parent value of selected=True. {"type": "RECORD", "stream": "countries", "record": {"code": "AD", "name": "Andorra", "native": "Andorra", "phone": "376", "continent": {"code": "EU", "name": "Europe"}, "capital": "Andorra la Vella", "currency": "EUR", "languages": [{"code": "ca", "name": "Catalan"}], "emoji": "\ud83c\udde6\ud83c\udde9"}, "time_extracted": "2021-05-10T22:54:22.843214Z"} ... ``` The WARNING entries above show that the parent value is being used even though the selection criteria has been specified for `code`, `name`, and `currency`. `SCHEMA` has the correct kept properties. ### Possible fixes When I traced this warning in the code, I noticed the breadcrumb didn’t include the expected `properties` in the tuple. Altering https://gitlab.com/meltano/singer-sdk/-/blob/main/singer_sdk/helpers/_catalog.py#L152 to be: ``` - property_breadcrumb: Tuple[str, ...] = tuple(list(breadcrumb) + [property_name]) + property_breadcrumb: Tuple[str, ...] = tuple(list(breadcrumb) + ['properties', property_name]) ``` fixes the issue because it properly references the correct breadcrumb structure.
issue