mani
09/16/2020, 12:10 AM(.venv) manigovindarajulu@Manis-MBP ga360 % meltano --log-level=info elt tap-ga360 target-jsonl --job_id=ga360_json11
meltano | Running extract & load...
meltano | No state was found, complete import.
meltano | Extract & load complete!
meltano | Transformation skipped.douwe_maan
09/16/2020, 3:10 PMtap-ga360 suggests that the catalog file Meltano is generating doesn't contain any streams marked as selected , since we would otherwise see a Syncing stream: <stream> message for each selected stream: https://github.com/singer-io/tap-ga360/blob/master/tap_ga360/__init__.py#L20
Do you see any "Selected attributes" when you run meltano select --list tap-ga360 ?mani
09/16/2020, 3:44 PMmani
09/16/2020, 3:44 PM(.venv) manigovindarajulu@Manis-MBP ga360 % meltano select --list tap-ga360
Cannot list the selected attributes: Extractor ‘tap-ga360’ does not support catalog discovery (the discover capability is not advertised)douwe_maan
09/16/2020, 3:51 PM--discover flag): https://github.com/singer-io/tap-ga360/blob/master/tap_ga360/__init__.py#L77, but Meltano currently thinks it doesn't (as indicated by your error message), so it's not actually discovering and generating a catalog, and not passing a --catalog flag to the tap, so parsed_args.catalog is unset, and the tap never makes it to this line: https://github.com/singer-io/tap-ga360/blob/master/tap_ga360/__init__.py#L79
To fix this, we should tell Meltano that your custom tap actually does support the discover and catalog capabilities , as well as state. Can you add them to your plugin definition in meltano.yml and try running meltano select --list tap-ga360 again?mani
09/16/2020, 3:58 PMmani
09/16/2020, 4:00 PMdouwe_maan
09/16/2020, 4:00 PMmani
09/16/2020, 4:21 PMdouwe_maan
09/16/2020, 4:37 PMmani
09/21/2020, 7:39 PMdouwe_maan
09/21/2020, 7:40 PMMeltano is responsible for managing the configuration of all of a project's plugins. It knows what settings are supported by each plugin, and how and when different types of plugins expect to be fed that configuration.
Since this also goes for extractors and loaders, you do not need to manually craft the `config.json` files expected by Singer taps and targets, because Meltano will generate them on the fly whenever an extractor or loader is used throughormeltano elt.meltano invoke
mani
09/21/2020, 7:42 PMdouwe_maan
09/21/2020, 7:43 PMdouwe_maan
09/21/2020, 7:43 PMmeltano config <plugin>douwe_maan
09/21/2020, 7:44 PMmeltano invoke <tap> , the config file will automatically be generated and provided to the tap using the --config option.douwe_maan
09/21/2020, 7:44 PMmani
09/21/2020, 7:53 PMmani
09/21/2020, 7:54 PMmani
09/21/2020, 7:55 PMmeltano config tap-ga360 set _metadata trafficSource * inclusion availablemani
09/21/2020, 7:56 PMmani
09/21/2020, 7:56 PMmani
09/21/2020, 7:56 PMmani
09/21/2020, 7:57 PMdouwe_maan
09/21/2020, 7:58 PM* in your command invocation is interpreted by your shell as "all files in this directory", so it's passing all of the filenames to meltano config instead of the literal string * .
If you'd like to actually send a literal * , wrap it in quotes: meltano config tap-ga360 set _metadata trafficSource "*" inclusion availablemani
09/21/2020, 7:59 PMdouwe_maan
09/21/2020, 7:59 PMmeltano config tap-ga360 set _metadata , you can also directly write your desired rules in meltano.yml like in the example here: https://meltano.com/docs/plugins.html#in-meltano-yml-3douwe_maan
09/21/2020, 8:05 PMmeltano elt tap-ga360 <target> --dump=catalog > catalog.jsondouwe_maan
09/21/2020, 8:06 PMmetadata extra in meltano.yml has been fixed, I expect it to just work 🙂mani
09/21/2020, 8:32 PMmani
09/21/2020, 8:33 PMmeltano --log-level=info select --list tap-ga360douwe_maan
09/21/2020, 8:33 PMmeltano eltmani
09/21/2020, 8:36 PMmani
09/21/2020, 8:36 PMmani
09/21/2020, 8:37 PM{
“breadcrumb”: [
“properties”,
“appInfo”,
“properties”,
“appInstallerId”
],
“metadata”: {
“inclusion”: “available”,
“selected”: false
}
},
{mani
09/21/2020, 8:38 PMmani
09/21/2020, 8:38 PMdouwe_maan
09/21/2020, 8:38 PMmeltano --log-level=debug elt ... and look at the SCHEMA messages tap-ga360 is outputting, do they contain additional fields compared to the RECORD messages?mani
09/21/2020, 8:39 PMmani
09/21/2020, 8:39 PMdouwe_maan
09/21/2020, 8:39 PMmani
09/21/2020, 8:40 PMdouwe_maan
09/21/2020, 8:40 PMdouwe_maan
09/21/2020, 8:40 PMmani
09/21/2020, 8:51 PMmani
09/21/2020, 8:51 PMmani
09/21/2020, 8:59 PMmani
09/21/2020, 8:59 PMdouwe_maan
09/21/2020, 9:00 PMselected metadata when building RECORD messages, but ignoring it when building SCHEMA messages, which thus always include all attributes/columns?douwe_maan
09/21/2020, 9:01 PMtarget-snowflake creating the unselected columns, but not having any values to store in them when the records come indouwe_maan
09/21/2020, 9:01 PMmani
09/21/2020, 9:24 PMmani
09/21/2020, 9:24 PMdouwe_maan
09/21/2020, 9:32 PMSCHEMA messages, so while this feels like a bug in https://github.com/singer-io/tap-ga360, it isn't technically one, and you'll probably find the same behavior in most if not all other taps: the unselected columns are created in the DB, even though they're never useddouwe_maan
09/21/2020, 9:33 PMSCHEMA messages to remove unselected properties, but that's not currently implemented. I welcome a new issue in https://gitlab.com/meltano/meltano/-/issues, though 🙂douwe_maan
09/21/2020, 9:33 PMmani
09/21/2020, 9:35 PMdouwe_maan
09/21/2020, 9:36 PMdouwe_maan
09/21/2020, 9:37 PMSCHEMA messages will still contain all attributesmani
09/21/2020, 9:39 PMdouwe_maan
09/21/2020, 9:40 PMmani
09/21/2020, 9:49 PMdouwe_maan
09/21/2020, 9:59 PMmani
09/21/2020, 10:07 PMmani
09/21/2020, 10:09 PMdouwe_maan
09/21/2020, 10:12 PMdouwe_maan
09/21/2020, 10:12 PMdouwe_maan
09/21/2020, 10:13 PMmani
09/21/2020, 10:13 PMmani
09/21/2020, 10:15 PMdouwe_maan
09/21/2020, 10:16 PMdouwe_maan
09/21/2020, 10:16 PMmani
09/21/2020, 10:17 PMmani
09/21/2020, 10:17 PMdouwe_maan
09/21/2020, 10:17 PMmani
09/22/2020, 4:06 PMmani
09/22/2020, 4:06 PMairflow initdb faileddouwe_maan
09/22/2020, 5:23 PMmani
09/22/2020, 5:40 PMdouwe_maan
09/22/2020, 5:41 PMmani
09/22/2020, 5:41 PMmani
09/24/2020, 7:47 PMmani
09/24/2020, 7:47 PMdouwe_maan
09/24/2020, 7:58 PMorchestrate/dags directory using meltano add files airflow ?mani
09/24/2020, 7:58 PMdouwe_maan
09/24/2020, 8:00 PMmeltano schedule , that will show up in meltano.yml under schedules ?douwe_maan
09/24/2020, 8:00 PMairflow scheduler output?mani
09/24/2020, 8:01 PMdouwe_maan
09/24/2020, 8:02 PMThis setup assumes you'll useto schedule yourmeltano schedulepipelines, as described above, since the DAG generator iterates over the result ofmeltano eltand creates DAGs for each.meltano schedule list --format=json
mani
09/24/2020, 8:07 PMmeltano schedule loadGA360 tap-ga360 target-snowflake @once
Traceback (most recent call last):
File “/usr/local/bin/meltano”, line 8, in <module>
sys.exit(main())
File “/usr/local/lib/python3.6/site-packages/meltano/cli/__init__.py”, line 38, in main
cli(obj={“project”: None})
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/meltano/cli/schedule.py”, line 54, in add
session, name, extractor, loader, transform, interval, start_date
File “/usr/local/lib/python3.6/site-packages/meltano/core/schedule_service.py”, line 57, in add
session, extractor
File “/usr/local/lib/python3.6/site-packages/meltano/core/schedule_service.py”, line 93, in default_start_date
return iso8601_datetime(start_date) or datetime.utcnow()
File “/usr/local/lib/python3.6/site-packages/meltano/core/utils/__init__.py”, line 234, in iso8601_datetime
raise ValueError(f”{d} is not a valid UTC date.“)
ValueError: 20200911 is not a valid UTC date.mani
09/24/2020, 8:07 PMmani
09/24/2020, 8:09 PMextractors:
- name: tap-ga360
namespace: tap_ga360
pip_url: tap-ga360
executable: tap-ga360
capabilities:
- catalog
- discover
- state
config:
start_date: ‘20200911’
project_id: peupnportaldouwe_maan
09/24/2020, 8:09 PM2020-09-11 fix this?douwe_maan
09/24/2020, 8:09 PMstart_date s follow the ISO8601 specdouwe_maan
09/24/2020, 8:10 PMmani
10/05/2020, 7:39 PMmani
10/05/2020, 7:41 PMdouwe_maan
10/05/2020, 8:58 PMSCHEMA message from the tap. Can you enable debug mode (meltano --log-level=debug elt ...), so that we can see the exact SCHEMA message that triggered this error?mani
10/06/2020, 2:13 PM{"type": "SCHEMA", "stream": "events", "schema": {"type": "object", "properties": {"start_date": {"anyOf": [{"type": "string", "format": "date-time"}, {}]}, "end_date": {"anyOf": [{"type": "string", "format": "date-time"}, {}]}, "updated_at": {"anyOf": [{"type": "string", "format": "date-time"}, {}]}, "created_at": {"anyOf": [{"type": "string", "format": "date-time"}, {}]}, "event_population_filters": {"anyOf": [{}]}, "notif_roles": {"anyOf": [{}]}, "deleted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {}]}}}, "key_properties": ["_id"]}mani
10/06/2020, 2:13 PMmani
10/06/2020, 2:14 PMmani
10/06/2020, 2:14 PM{
“streams”: [
{
“table_name”: “events”,
“stream”: “events”,
“metadata”: [
{
“breadcrumb”: [],
“metadata”: {
“table-key-properties”: [
“_id”
],
“database-name”: “unified_admin”,
“row-count”: 6,
“is-view”: false,
“valid-replication-keys”: [
“_id”
],
“selected”: true,
“replication-method”: “FULL_TABLE”,
“replication-key”: “_id”,
“replication_key_type”: “String”
}
}
],
“tap_stream_id”: “unified_admin-events”,
“schema”: {
“type”: [
“null”,
“object”
],
“properties”: {
“_id”: {
“type”: [
“null”,
“string”
]
},
“title”: {
“type”: [
“null”,
“string”
]
}
}
},
“selected”: true
}
]
}douwe_maan
10/06/2020, 3:38 PM"type" key:
"event_population_filters": { "anyOf": [{}] },
"notif_roles": { "anyOf": [{}] },
The other properties also have an empty object at the end of their anyOf arrays, which is also invalid, but is ignored by the target since they define at least one type:
"start_date": {"anyOf": [{"type": "string", "format": "date-time"}, {}]}douwe_maan
10/06/2020, 3:38 PMmani
10/06/2020, 3:41 PMmani
10/06/2020, 3:43 PMmani
10/06/2020, 3:44 PMdouwe_maan
10/06/2020, 3:50 PMmetadata object, it'd look like:
"tap-mongodb.projection": "{\"_id\": 1, \"title\": 1}"
(It needs to be an escaped JSON string per https://github.com/singer-io/tap-mongodb/blob/f0fcc01e679acb40689b952d418425500fd17612/tap_mongodb/__init__.py#L239)douwe_maan
10/06/2020, 3:54 PMmetadata in meltano.yml , as in https://meltano.com/docs/plugins.html#metadata-extra, or are you manually building and specifying a catalog file?
Using the YAML metadata feature won't work here, unfortunately, because it would interpret tap-mongodb.projection: <value> as a projection metadata key for the (nonexistent) tap-mongodb property, rather than a ``tap-mongodb.projection`` metadata key for the stream as a whole, because periods are interpreted as nested properties: https://meltano.com/docs/command-line-interface.html#nested-properties
So to try this out, I'd suggest building and providing a catalog file manually. We can then look into fixing this issue in Meltano.mani
10/06/2020, 4:07 PMdouwe_maan
10/08/2020, 11:40 PM