Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/src/baserow/contrib/database/fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ def __class__(self):
# expression field.
return self.expression_field.__class__

def get_placeholder(self, value, compiler, connection):
return "%s"

def get_transform(self, name):
# When a model field of this type is pickled and stored in the Baserow model
# cache, the lookups on the class setup in the __init__ are not persisted.
Expand Down
37 changes: 37 additions & 0 deletions backend/tests/baserow/contrib/database/rows/test_rows_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
extract_user_field_names_from_params,
get_include_exclude_fields,
)
from baserow.contrib.database.fields.handler import FieldHandler
from baserow.contrib.database.fields.models import SelectOption
from baserow.contrib.database.rows.exceptions import RowDoesNotExist
from baserow.contrib.database.rows.handler import RowHandler
Expand Down Expand Up @@ -1082,6 +1083,42 @@ def test_import_rows_with_read_only_field(
assert len(rows) == 0


@pytest.mark.django_db
def test_import_rows_with_broken_lookup_field(data_fixture):
user = data_fixture.create_user()
table = data_fixture.create_database_table(user=user)
table2 = data_fixture.create_database_table(user=user, database=table.database)
data_fixture.create_text_field(name="primary", table=table, primary=True)
target_field = data_fixture.create_text_field(
name="target", table=table2, primary=True
)

linkrowfield = FieldHandler().create_field(
user, table, "link_row", name="link", link_row_table=table2
)
FieldHandler().create_field(
user,
table,
"lookup",
name="lookup",
through_field_id=linkrowfield.id,
target_field_id=target_field.id,
)

FieldHandler().update_field(user, linkrowfield.specific, new_type_name="text")

handler = RowHandler()
rows, report = handler.import_rows(
user=user,
table=table,
data=[["row1", ""], ["row2", ""]],
send_realtime_update=False,
)

assert len(rows) == 2
assert report == {}


@pytest.mark.django_db
@patch("baserow.contrib.database.rows.signals.rows_updated.send")
@patch("baserow.contrib.database.rows.signals.before_rows_update.send")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Fix DatatypeMismatch on bulk insert for tables with formula fields",
"issue_origin": "github",
"issue_number": 4992,
"domain": "database",
"bullet_points": [],
"created_at": "2026-03-17"
}
Loading