superduper icon indicating copy to clipboard operation
superduper copied to clipboard

[BUGS-0.2.0] Run end-to-end tests on snowflake

Open fnikolai opened this issue 1 year ago • 1 comments
trafficstars

Running pytest -s test_end_2_end.py on Snowflake fails with invalid identifier 'UUID'

    @staticmethod
    def default_errorhandler(
        connection: SnowflakeConnection,
        cursor: SnowflakeCursor,
        error_class: type[Error],
        error_value: dict[str, str],
    ) -> None:
        """Default error handler that raises an error.
    
        Args:
            connection: Connections in which the error happened.
            cursor: Cursor in which the error happened.
            error_class: Class of error that needs handling.
            error_value: A dictionary of the error details.
    
        Raises:
            A Snowflake error.
        """
        errno = error_value.get("errno")
        done_format_msg = error_value.get("done_format_msg")
>       raise error_class(
            msg=error_value.get("msg"),
            errno=None if errno is None else int(errno),
            sqlstate=error_value.get("sqlstate"),
            sfqid=error_value.get("sfqid"),
            query=error_value.get("query"),
            done_format_msg=(
                None if done_format_msg is None else bool(done_format_msg)
            ),
            connection=connection,
            cursor=cursor,
        )
E       sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 000904 (42000): SQL compilation error: error line 1 at position 27
E       invalid identifier 'UUID'
E       [SQL: INSERT INTO component (id, uuid, identifier, version, hidden, type_id, _path, dict) VALUES (%(id)s, %(uuid)s, %(identifier)s, %(version)s, %(hidden)s, %(type_id)s, %(_path)s, %(dict)s)]
E       [parameters: {'id': 'datatype/pil_image/0', 'uuid': 'f24cb4a3-9e69-44cd-b2be-8febce81af5c', 'identifier': 'pil_image', 'version': 0, 'hidden': False, 'type_id': 'datatype', '_path': 'superduperdb/components/datatype/DataType', 'dict': '{"uuid": "f24cb4a3-9e69-44cd-b2be-8febce81af5c", "encoder": "?artifact/e6eb888f0b0fbbab905029cb309537b9383919a6", "decoder": "?artifact/ee1a946181f06 ... (1106 characters truncated) ... 8218", "uri": null, "sha1": null}}, "_files": [], "_blobs": ["e6eb888f0b0fbbab905029cb309537b9383919a6", "ee1a946181f065af29a3c8637b2858b153d8fc8e"]}'}]
E       (Background on this error at: https://sqlalche.me/e/14/f405)

../../../.local/lib/python3.10/site-packages/snowflake/connector/errors.py:221: ProgrammingError

The stack:

test_end_2_end.py:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../superduperdb/misc/annotations.py:119: in decorated
    return f(*args, **kwargs)
../../superduperdb/base/datalayer.py:480: in add
    return self.apply(object, dependencies=dependencies)
../../superduperdb/base/datalayer.py:507: in apply
    return self._add(object=object, dependencies=dependencies), object
../../superduperdb/base/datalayer.py:897: in _add
    self.metadata.create_component(serialized)
../../superduperdb/backends/sqlalchemy/metadata.py:203: in create_component
    session.execute(stmt)
../../../.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py:1717: in execute
    result = conn._execute_20(statement, params or {}, execution_options)
../../../.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1710: in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
../../../.local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py:334: in _execute_on_connection
    return connection._execute_clauseelement(
../../../.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1577: in _execute_clauseelement
    ret = self._execute_context(
../../../.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1953: in _execute_context
    self._handle_dbapi_exception(
../../../.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2134: in _handle_dbapi_exception
    util.raise_(
../../../.local/lib/python3.10/site-packages/sqlalchemy/util/compat.py:211: in raise_
    raise exception
../../../.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1910: in _execute_context
    self.dialect.do_execute(
../../../.local/lib/python3.10/site-packages/sqlalchemy/engine/default.py:736: in do_execute
    cursor.execute(statement, parameters)
../../../.local/lib/python3.10/site-packages/snowflake/connector/cursor.py:1080: in execute
    Error.errorhandler_wrapper(self.connection, self, error_class, errvalue)
../../../.local/lib/python3.10/site-packages/snowflake/connector/errors.py:290: in errorhandler_wrapper
    handed_over = Error.hand_to_other_handler(
../../../.local/lib/python3.10/site-packages/snowflake/connector/errors.py:345: in hand_to_other_handler
    cursor.errorhandler(connection, cursor, error_class, error_value)

fnikolai avatar May 21 '24 17:05 fnikolai