This is an automated email from the ASF dual-hosted git repository.

dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 241834205f fix: remove info from datasource access error (#29470)
241834205f is described below

commit 241834205f20b6fbca682fa479708eb5611e8634
Author: Daniel Vaz Gaspar <[email protected]>
AuthorDate: Mon Jul 8 14:39:20 2024 +0100

    fix: remove info from datasource access error (#29470)
---
 superset/security/manager.py                    | 4 ++--
 tests/integration_tests/datasource/api_tests.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/superset/security/manager.py b/superset/security/manager.py
index b4bc0c6103..d03da75079 100644
--- a/superset/security/manager.py
+++ b/superset/security/manager.py
@@ -580,7 +580,7 @@ class SupersetSecurityManager(  # pylint: 
disable=too-many-public-methods
         """
 
         return (
-            f"This endpoint requires the datasource {datasource.name}, "
+            f"This endpoint requires the datasource {datasource.id}, "
             "database or `all_datasource_access` permission"
         )
 
@@ -612,7 +612,7 @@ class SupersetSecurityManager(  # pylint: 
disable=too-many-public-methods
             level=ErrorLevel.WARNING,
             extra={
                 "link": self.get_datasource_access_link(datasource),
-                "datasource": datasource.name,
+                "datasource": datasource.id,
             },
         )
 
diff --git a/tests/integration_tests/datasource/api_tests.py 
b/tests/integration_tests/datasource/api_tests.py
index 6f25a0c81a..d9f3650793 100644
--- a/tests/integration_tests/datasource/api_tests.py
+++ b/tests/integration_tests/datasource/api_tests.py
@@ -129,7 +129,7 @@ class TestDatasourceApi(SupersetTestCase):
         response = json.loads(rv.data.decode("utf-8"))
         self.assertEqual(
             response["message"],
-            "This endpoint requires the datasource virtual_dataset, "
+            f"This endpoint requires the datasource {table.id}, "
             "database or `all_datasource_access` permission",
         )
 

Reply via email to