Open edgarrmondragon opened 2 months ago
The trace is
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 941,
cursor.execute(statement, parameters)
psycopg2.errors.DuplicateObject: type "companycategory" already exists
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/project/.meltano/loaders/target-postgres/venv/bin/target-postgres", line 8, in <module>
sys.exit(TargetPostgres.cli())
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/plugin_base.py", line 80, in invoke
return super().invoke(ctx)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 567, in invoke
target.listen(file_input)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/io_base.py", line 36, in listen
self._process_lines(file_input)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 307, in _process_lines
counter = super()._process_lines(file_input)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/io_base.py", line 95, in _process_lines
self._process_record_message(line_dict)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 371, in _process_record_message
self.drain_one(sink)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/singer_sdk/target_base.py", line 512, in drain_one
sink.process_batch(draining_status)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/sinks.py", line 85, in process_batch
temp_table: sa.Table = self.connector.copy_table_structure(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/connector.py", line 185, in copy_table_structure
new_table.create(bind=connection)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 1284, in create
bind._run_ddl_visitor(ddl.SchemaGenerator, self, checkfirst=checkfirst)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2459, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 664, in traverse_single
return meth(obj, **kw)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 938, in visit_table
with self.with_ddl_events(
File "/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 822, in with_ddl_events
target.dispatch.before_create(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/event/attr.py", line 497, in __call__
fn(*args, **kw)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 852, in __call__
return getattr(self.target, self.name)(*arg, **kw)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/named_types.py", line 98, in _on_table_create
self.create(bind=bind, checkfirst=checkfirst)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/named_types.py", line 338, in create
super().create(bind, checkfirst=checkfirst)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/named_types.py", line 51, in create
bind._run_ddl_visitor(self.DDLGenerator, self, checkfirst=checkfirst)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2459, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 664, in traverse_single
return meth(obj, **kw)
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/named_types.py", line 153, in visit_enum
self.connection.execute(CreateEnumType(enum))
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
return meth(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 180, in _execute_on_connection
return connection._execute_ddl(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1529, in _execute_ddl
ret = self._execute_context(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/project/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 941,
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateObject) type "companycategory" already exists
[SQL: CREATE TYPE companycategory AS ENUM ('ONE', 'TWO', 'THREE', 'FOUR')]
(Background on this error at: https://sqlalche.me/e/20/f405)
The type companycategory
has been created like
CREATE TYPE public.companycategory AS ENUM (
'ONE',
'TWO',
'THREE',
'FOUR'
);
column1
in target postgres is companycategory
type
Target Version
0.0.14
Python Version
3.12
PostgreSQL Version
Do not know
Operating System
NA
Description
Link to Slack/Linen
https://meltano.slack.com/archives/C069CQNHDNF/p1724772642004549