fix(gsheets): update params from encrypted extra (#32661)

This commit is contained in:
Beto Dealmeida
2025-03-14 12:00:53 -04:00
committed by Michael S. Molina
parent 24c120135c
commit 3f2ddbac82
2 changed files with 34 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
# pylint: disable=import-outside-toplevel, invalid-name, line-too-long
from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING
from urllib.parse import parse_qs, urlparse
import pandas as pd
@@ -670,3 +670,23 @@ def test_get_oauth2_fresh_token(
},
timeout=30.0,
)
def test_update_params_from_encrypted_extra(mocker: MockerFixture) -> None:
"""
Test `update_params_from_encrypted_extra`.
"""
from superset.db_engine_specs.gsheets import GSheetsEngineSpec
database = mocker.MagicMock(
encrypted_extra=json.dumps(
{
"oauth2_client_info": "SECRET",
"foo": "bar",
}
)
)
params: dict[str, Any] = {}
GSheetsEngineSpec.update_params_from_encrypted_extra(database, params)
assert params == {"foo": "bar"}