Skip to content

SQL hooks can't execute #23

@edgarrmondragon

Description

@edgarrmondragon

SQL hooks before_run_sql and after_run_sql fail to execute with the following error message:

Traceback (most recent call last):
  File "/project/.meltano/loaders/target-snowflake/venv/bin/target-snowflake", line 8, in <module>
    sys.exit(cli())
  File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.8/site-packages/target_snowflake/__init__.py", line 57, in cli
    main(args.config)
  File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.8/site-packages/target_snowflake/__init__.py", line 51, in main
    target_tools.main(target)
  File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.8/site-packages/target_postgres/target_tools.py", line 28, in main
    stream_to_target(input_stream, target, config=config)
  File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.8/site-packages/target_postgres/target_tools.py", line 44, in stream_to_target
    _run_sql_hook('before_run_sql', config, target)
  File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.8/site-packages/target_postgres/target_tools.py", line 188, in _run_sql_hook
    with target.conn.cursor() as cur:
AttributeError: 'SnowflakeTarget' object has no attribute 'conn'

Seems to be caused by this target using a different attribute name for the SQLAlchemy connection (self.connection instead of self.conn).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions