fix(dataset): add email field to owners_data for Chart Explore path (#38836)

This commit is contained in:
Krishna Chaitanya
2026-03-27 05:44:11 -07:00
committed by GitHub
parent 5c782397bb
commit ac96f46c76
2 changed files with 32 additions and 0 deletions

View File

@@ -946,3 +946,34 @@ def test_data_for_slices_handles_missing_datasource(mocker: MockerFixture) -> No
assert "columns" in result
assert "metrics" in result
assert "verbose_map" in result
def test_owners_data_includes_email(mocker: MockerFixture) -> None:
"""Test that the owners_data property includes the email field."""
database = mocker.MagicMock()
table = SqlaTable(
table_name="test_table",
database=database,
columns=[],
metrics=[],
)
mock_owner = mocker.MagicMock()
mock_owner.first_name = "John"
mock_owner.last_name = "Doe"
mock_owner.username = "johndoe"
mock_owner.id = 1
mock_owner.email = "john@example.com"
table.owners = [mock_owner]
owners_data = table.owners_data
assert len(owners_data) == 1
assert owners_data[0] == {
"first_name": "John",
"last_name": "Doe",
"username": "johndoe",
"id": 1,
"email": "john@example.com",
}