joao_vitor_ferreira_silva
02/16/2022, 2:07 PMpat_nadolny
02/16/2022, 2:28 PMjoao_vitor_ferreira_silva
02/16/2022, 3:48 PMjoao_vitor_ferreira_silva
02/16/2022, 3:49 PMpat_nadolny
02/16/2022, 6:32 PMpat_nadolny
02/16/2022, 6:33 PMedgar_ramirez_mondragon
02/16/2022, 6:40 PMDo we have any setting to keep the "father object name"? Like "deals.id"@joao_vitor_ferreira_silva do you mean this is a nested array turned into a new table, that by chance got an unnested field with the same name as the parent table?
joao_vitor_ferreira_silva
02/16/2022, 7:29 PMValueError: Duplicate column name produced in schema: phtbccadc__value cmd_type=loader job_id=hubspot-to-postgres name=target-postgres run_id=94cbbb95-ca7f-4c54-9283-b97130176b6b stdio=stderr
so i start to think the problem could be with the columns, right? (Sorry if not, i'm just a begginer with Meltano)joao_vitor_ferreira_silva
02/16/2022, 7:46 PMdb_sync.py
of target-postgres
folder in this piece of code :
def flatten_schema(d, parent_key=[], sep='__', level=0, max_level=0):
items = []
if 'properties' not in d:
return {}
for k, v in d['properties'].items():
new_key = flatten_key(k, parent_key, sep)
if 'type' in v.keys():
if 'object' in v['type'] and 'properties' in v and level < max_level:
items.extend(flatten_schema(v, parent_key + [k], sep=sep, level=level + 1, max_level=max_level).items())
else:
items.append((new_key, v))
else:
if len(v.values()) > 0:
if list(v.values())[0][0]['type'] == 'string':
list(v.values())[0][0]['type'] = ['null', 'string']
items.append((new_key, list(v.values())[0][0]))
elif list(v.values())[0][0]['type'] == 'array':
list(v.values())[0][0]['type'] = ['null', 'array']
items.append((new_key, list(v.values())[0][0]))
elif list(v.values())[0][0]['type'] == 'object':
list(v.values())[0][0]['type'] = ['null', 'object']
items.append((new_key, list(v.values())[0][0]))
key_func = lambda item: item[0]
sorted_items = sorted(items, key=key_func)
for k, g in itertools.groupby(sorted_items, key=key_func):
if len(list(g)) > 1:
raise ValueError('Duplicate column name produced in schema: {}'.format(k))
return dict(sorted_items)
pat_nadolny
02/16/2022, 7:50 PMmeltano invoke tap-hubspot > output.json
will send the output to a file. You can share some of that as long as its non-sensitive data