On to another issue, I am running a basic ELT flow...
# plugins-general
t
On to another issue, I am running a basic ELT flow on tap-salesforce and target-postgres but the following error keeps popping up: tap-salesforce | Exception: Error syncing User: [Errno 32] Broken pipe tap-salesforce | Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'> tap-salesforce | BrokenPipeError: [Errno 32] Broken pipe meltano     | Extraction failed (120): BrokenPipeError: [Errno 32] Broken pipe meltano     | Loading failed (1): ValueError: Unsupported column type anyOf: LastLoginDate I researched on my own but cannot figure this out.
d
@timothy_suh The error messages indicates that in the
SCHEMA
output by the tap, the
LastLoginDate
property is defined as having either type A or type B (
anyOf: [a, b]
) which is not supported by target-postgres since a database column can only have one type: https://github.com/meltano/target-postgres/blob/master/target_postgres/db_sync.py#L81 Can you find out what the type of
LastLoginDate
looks like by running
meltano elt
in debug mode (
meltano --log-level=debug elt ...
) and sharing the offending
SCHEMA
message? Depending on what the
anyOf
type looks like exactly, we may be able to override it with a single type in the catalog file using the
schema
extra: https://meltano.com/docs/plugins.html#schema-extra
t
schema shows "LastLoginDate": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": ["string", "null"]}]}
d
All right,
tap-postgres
is tripping over the fact that the second option repeats the
string
type. This would've been fine:
Copy code
"LastLoginDate": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}]}
You can tell Meltano to override the schema for the LastLoginData property in the catalog file it passes to
tap-salesforce
(which it hopefully uses to generate its
SCHEMA
messages), like this (with the correct entity/stream ID):
Copy code
meltano config tap-salesforce set _schema <stream ID> LastLoginDate anyOf '[{"type": "string", "format": "date-time"}, {"type": "null"}]'
In
meltano.yml
, the result of that will look something like this: https://meltano.com/docs/plugins.html#in-meltano-yml-4
t
I have to do this for every date field - oh boy!
d
If all the date fields end in
Date
, you should be able to use
*
as the entity identifier, and
*Date
as the attribute identifier, to catch all properties at once!
Copy code
meltano config tap-salesforce set _schema '*' '*Date' anyOf '[{"type": "string", "format": "date-time"}, {"type": "null"}]'
t
Trying it now - beautiful solution!
I had to add one more attribute which did not end in "*date" but then everything worked! THank you.
d
Awesome!