Skip to content

Commit 6b81b17

Browse files
committed
🔊 more comprehensive error message regarding invalid column_type
1 parent 72d37d5 commit 6b81b17

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mysql_to_sqlite3/transporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _translate_type_from_mysql_to_sqlite(
202202
# This could be optimized even further, however is seems adequate.
203203
match: t.Optional[t.Match[str]] = cls._valid_column_type(_column_type)
204204
if not match:
205-
raise ValueError("Invalid column_type!")
205+
raise ValueError(f'"${_column_type}" is not a valid column_type!')
206206

207207
data_type: str = match.group(0).upper()
208208

tests/unit/mysql_to_sqlite3_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_translate_type_from_mysql_to_sqlite_invalid_column_type(
2626
with pytest.raises(ValueError) as excinfo:
2727
mocker.patch.object(MySQLtoSQLite, "_valid_column_type", return_value=False)
2828
MySQLtoSQLite._translate_type_from_mysql_to_sqlite(column_type="text")
29-
assert "Invalid column_type!" in str(excinfo.value)
29+
assert "is not a valid column_type!" in str(excinfo.value)
3030

3131
def test_translate_type_from_mysql_to_sqlite_all_valid_columns(self) -> None:
3232
for column_type in mysql_column_types + (

0 commit comments

Comments
 (0)