will_johnson
06/24/2022, 4:57 PMmeltano lock tap-postgres? That resulted in the same lock file which didn't have the capabilities I added to meltano.yml. So, there another plugin definition file I should be looking at?taylor
06/24/2022, 5:05 PMplugins:
extractors:
- name: tap-postgres
variant: transferwise
pip_url: pipelinewise-tap-postgres
capabilities:
- properties
- discover
- state
but now that I think about it that may not be respected if you don't declare it as a custom plugin... @edgar_ramirez_mondragon am I mis-stating things here?taylor
06/24/2022, 5:06 PMedgar_ramirez_mondragon
06/24/2022, 5:12 PMmetadata is incorrectly nested inside config , while it should be at the same level (bump for #2964)will_johnson
06/24/2022, 5:13 PMtaylor
06/24/2022, 5:13 PMtaylor
06/24/2022, 5:16 PMtaylor
06/24/2022, 5:19 PMwill_johnson
06/24/2022, 5:25 PMwill_johnson
06/24/2022, 7:28 PMwill_johnson
06/24/2022, 7:43 PM23 2022-06-24T19:35:58.966414Z [info ] File "/mnt/c/Users/wjohnson/workspace/meltano-projects/meltano_debug/.meltano/extractors/tap-postgres/venv/lib/python3.8/site-packages/tap_postgres/sync_strategies/incremental.py", line 61, in sync_table cmd_type=extractor name=tap-postgres run_i d=10a613ba-d5e6-4fa3-935f-1ba1a6b83d5b state_id=test2 stdio=stderr
24 2022-06-24T19:35:58.967154Z [info ] replication_key_sql_datatype = md_map.get(('properties', replication_key)).get('sql-datatype') cmd_type=extractor name=tap-postgres run_id=10a613ba-d5e6-4fa3-935f-1ba1a6b83d5b state_id=test2 stdio=stderr
25 2022-06-24T19:35:58.967790Z [info ] AttributeError: 'NoneType' object has no attribute 'get' cmd_type=extractor name=tap-postgres run_id=10a613ba-d5e6-4fa3-935f-1ba1a6b83d5b state_id=test2 stdio=stderrtaylor
06/24/2022, 8:04 PMwill_johnson
06/24/2022, 8:07 PMwill_johnson
06/24/2022, 8:12 PMdouwe_maan
06/24/2022, 8:13 PM[null] at the very end of the following SCHEMA message reveals the issue
{
"type": "SCHEMA",
"stream": "src_sample_store-widgets",
"schema": {
"type": "object",
"properties": {
"id": {
"type": [
"integer"
],
"minimum": -2147483648,
"maximum": 2147483647
},
"name": {
"type": [
"null",
"string"
]
},
"widget_type": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
],
"format": "date-time"
},
"updated_at": {
"type": [
"null",
"string"
],
"format": "date-time"
}
},
"definitions": {
"sdc_recursive_integer_array": {
"type": [
"null",
"integer",
"array"
],
"items": {
"$ref": "#/definitions/sdc_recursive_integer_array"
}
},
"sdc_recursive_number_array": {
"type": [
"null",
"number",
"array"
],
"items": {
"$ref": "#/definitions/sdc_recursive_number_array"
}
},
"sdc_recursive_string_array": {
"type": [
"null",
"string",
"array"
],
"items": {
"$ref": "#/definitions/sdc_recursive_string_array"
}
},
"sdc_recursive_boolean_array": {
"type": [
"null",
"boolean",
"array"
],
"items": {
"$ref": "#/definitions/sdc_recursive_boolean_array"
}
},
"sdc_recursive_timestamp_array": {
"type": [
"null",
"string",
"array"
],
"format": "date-time",
"items": {
"$ref": "#/definitions/sdc_recursive_timestamp_array"
}
},
"sdc_recursive_object_array": {
"type": [
"null",
"object",
"array"
],
"items": {
"$ref": "#/definitions/sdc_recursive_object_array"
}
}
}
},
"key_properties": [
"id"
],
"bookmark_properties": [
null
]
}douwe_maan
06/24/2022, 8:16 PMreplication-key: updated_at isn’t being picked up correctly. Let’s start by verifying it makes it into the generated catalog file that is passed to the tap as expected. Can you run meltano invoke --dump=catalog tap-postgres and share either the whole file or the relevant bits concerning src_sample_store-widgets?will_johnson
06/24/2022, 8:19 PMwill_johnson
06/24/2022, 8:19 PMdouwe_maan
06/24/2022, 8:20 PMmetadata doesn’t work properly under environments .douwe_maan
06/24/2022, 8:20 PMselect doesn’t either. Can you move this to the top level plugins/extractors/tap-postgres definition? (with fixed indentation)
plugins:
extractors:
- name: tap-postgres
variant: transferwise
pip_url: pipelinewise-tap-postgres
metadata:
src_sample_store-widgets:
replication-key: updated_at
replication-method: INCREMENTAL
select:
- src_sample_store-widgets.created_at
- src_sample_store-widgets.id
- src_sample_store-widgets.name
- src_sample_store-widgets.updated_atdouwe_maan
06/24/2022, 8:21 PMwill_johnson
06/24/2022, 8:24 PMwill_johnson
06/24/2022, 8:25 PMwill_johnson
06/24/2022, 8:26 PMdouwe_maan
06/24/2022, 8:26 PMwill_johnson
06/24/2022, 8:28 PMwill_johnson
06/24/2022, 8:28 PMwill_johnson
06/24/2022, 8:30 PMdouwe_maan
06/24/2022, 8:31 PMselected metadata? A few of them of them are in this Slack as well. I think it’s definitely worth submitting a PR so there’s specific code to debate over.juan_luis_cano_rodriguez
06/25/2022, 6:22 AMI understand the reasoning behind the current behavior and #58: if the source schema changes, there is potential data loss. However, now tap-postgres is "too smart" about it and we can't even choose how do we want to extract our data, which is annoying.
Would the maintainers accept a simpler PR that does not do a discovery phase if an explicit catalog is provided?but so far no response. As you say, an alternative is to, rather than completely revert the "refresh schema always", do so in a way that at least the
selected metadata is preserved. I'm happy to send a PR but I would not like to put the work without someone on the other side at least saying "yay, let's try"douwe_maan
06/27/2022, 2:49 PMpeter_kosztolanyi
06/27/2022, 3:06 PMAs long they describe pipelinewise-tap-postgres as a Singer tap and not something PipelineWise-specific, any behavior that goes against the Singer spec is a bugI personally agree with this sentence. Even if ppw taps are extended ones they are still meant to be compatible with the singer spec. Since #58 is merged, all changes in the catalog file are lost which were made manually or by external tools. I didn't look into the code but making this behaviour optional maybe should fix the problem? 🤷