The sync_to_dolt function doesn't catch empty commit errors properly. Also, if there aren't any changes to commit, why is the function trying to commit them?
Traceback (most recent call last):
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1705, in _execute_context
self.dialect.do_execute(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\default.py", line 681, in do_execute
cursor.execute(statement, parameters)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\cursor.py", line 569, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 599, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 487, in _handle_result
raise errors.get_exception(packet)
mysql.connector.errors.DatabaseError: 1105 (HY000): Cannot commit an empty commit. See the --allow-empty if you want to.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\evani\git\metamonster\metamonster\main.py", line 16, in
main()
File "C:\Users\evani\git\metamonster\metamonster\main.py", line 12, in main
args.func(args)
File "C:\Users\evani\git\metamonster\metamonster\sync.py", line 169, in sync
database.sync_data(config.dolt_config)
File "C:\Users\evani\git\metamonster\metamonster\sync.py", line 78, in sync_data
sync_to_dolt(reader, writer, self.mappings)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sync\sync_tools.py", line 37, in sync_to_dolt
_sync_helper(source_reader, target_writer, table_map)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sync\sync_tools.py", line 66, in _sync_helper
target_writer(remapped)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sync\dolt.py", line 45, in inner
return dsc.commit_tables(message or "Executed SQL sync", tables, True)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sql.py", line 103, in commit_tables
result = [dict(row) for row in conn.execute(f"SELECT DOLT_COMMIT({dolt_commit_args})")]
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1185, in execute
return self._exec_driver_sql(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1484, in _exec_driver_sql
ret = self._execute_context(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1748, in _execute_context
self._handle_dbapi_exception(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1929, in _handle_dbapiexception
util.raise(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\util\compat.py", line 198, in raise_
raise exception
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1705, in _execute_context
self.dialect.do_execute(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\default.py", line 681, in do_execute
cursor.execute(statement, parameters)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\cursor.py", line 569, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 599, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 487, in _handle_result
raise errors.get_exception(packet)
sqlalchemy.exc.DatabaseError: (mysql.connector.errors.DatabaseError) 1105 (HY000): Cannot commit an empty commit. See the --allow-empty if you want to.
[SQL: SELECT DOLT_COMMIT('-m', 'Executed SQL sync')]
(Background on this error at: http://sqlalche.me/e/14/4xp6)
The
sync_to_dolt
function doesn't catch empty commit errors properly. Also, if there aren't any changes to commit, why is the function trying to commit them?Traceback (most recent call last): File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1705, in _execute_context self.dialect.do_execute( File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\default.py", line 681, in do_execute cursor.execute(statement, parameters) File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\cursor.py", line 569, in execute self._handle_result(self._connection.cmd_query(stmt)) File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 599, in cmd_query result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 487, in _handle_result raise errors.get_exception(packet) mysql.connector.errors.DatabaseError: 1105 (HY000): Cannot commit an empty commit. See the --allow-empty if you want to.
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Users\evani\git\metamonster\metamonster\main.py", line 16, in
main()
File "C:\Users\evani\git\metamonster\metamonster\main.py", line 12, in main
args.func(args)
File "C:\Users\evani\git\metamonster\metamonster\sync.py", line 169, in sync
database.sync_data(config.dolt_config)
File "C:\Users\evani\git\metamonster\metamonster\sync.py", line 78, in sync_data
sync_to_dolt(reader, writer, self.mappings)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sync\sync_tools.py", line 37, in sync_to_dolt
_sync_helper(source_reader, target_writer, table_map)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sync\sync_tools.py", line 66, in _sync_helper
target_writer(remapped)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sync\dolt.py", line 45, in inner
return dsc.commit_tables(message or "Executed SQL sync", tables, True)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\doltpy\sql\sql.py", line 103, in commit_tables
result = [dict(row) for row in conn.execute(f"SELECT DOLT_COMMIT({dolt_commit_args})")]
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1185, in execute
return self._exec_driver_sql(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1484, in _exec_driver_sql
ret = self._execute_context(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1748, in _execute_context
self._handle_dbapi_exception(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1929, in _handle_dbapiexception
util.raise(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\util\compat.py", line 198, in raise_
raise exception
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\base.py", line 1705, in _execute_context
self.dialect.do_execute(
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\sqlalchemy\engine\default.py", line 681, in do_execute
cursor.execute(statement, parameters)
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\cursor.py", line 569, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 599, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File "C:\Users\evani\AppData\Local\pypoetry\Cache\virtualenvs\metamonster-upuCDUwE-py3.9\lib\site-packages\mysql\connector\connection.py", line 487, in _handle_result
raise errors.get_exception(packet)
sqlalchemy.exc.DatabaseError: (mysql.connector.errors.DatabaseError) 1105 (HY000): Cannot commit an empty commit. See the --allow-empty if you want to.
[SQL: SELECT DOLT_COMMIT('-m', 'Executed SQL sync')]
(Background on this error at: http://sqlalche.me/e/14/4xp6)