You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "FGrobelny (via GitHub)" <gi...@apache.org> on 2023/11/06 13:00:52 UTC

[PR] fix(trino): allow impersonate_user flag to be imported [superset]

FGrobelny opened a new pull request, #25872:
URL: https://github.com/apache/superset/pull/25872

   ### SUMMARY
   `impersonate_user` flag allows for user impersonation when connecting to trino using kerberos. Currently it cannot be imported. 
   
   
   ### TESTING INSTRUCTIONS
   1. Create trino_from_ui connection using UI, check "impersonate user" box. 
   2. Create trino_from_code connection file
   ```
       import_datasources.yaml: |
         databases:
         - database_name: Trino
           sqlalchemy_uri: <url>
           cache_timeout: null
           expose_in_sqllab: true
           allow_run_async: true
           allow_ctas: true
           allow_cvas: true
           allow_dml: true
           allow_csv_upload: true
           impersonate_user: true
           extra: "<extra>"
           encrypted_extra: "<encrypted_extra>"
   ```
   4. Import datasources using `superset import_datasources -p import_datasources.yaml`
   5. Check in database if impersonate_user = "t" in "dbs" table for both connections.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(trino): allow impersonate_user flag to be imported [superset]

Posted by "NickLarsenNZ (via GitHub)" <gi...@apache.org>.
NickLarsenNZ commented on PR #25872:
URL: https://github.com/apache/superset/pull/25872#issuecomment-1847319249

   @FGrobelny, just wanted to clarify if this should work for importing a Zip via the api (`POST /api/v1/assets/import`)?
   
   I am getting the following error (in superset 3.0.1):
   
   ```json
   {
     "errors": [
       {
         "message": "Error importing assets",
         "error_type": "GENERIC_COMMAND_ERROR",
         "level": "warning",
         "extra": {
           "databases/Trino_tpch.yaml": {
             "impersonate_user": [
               "Unknown field."
             ]
           },
           "issue_codes": [
             {
               "code": 1010,
               "message": "Issue 1010 - Superset encountered an error while running a command."
             }
           ]
         }
       }
     ]
   }
   ```
   
   I have no other assets, just this connection:
   
   ```yaml
   database_name: Trino tpch
   sqlalchemy_uri: trino://superset:XXXXXXXXXX@trino:8443/tpch?verify=false
   cache_timeout: null
   expose_in_sqllab: true
   allow_run_async: false
   allow_ctas: false
   allow_cvas: false
   allow_dml: false
   allow_csv_upload: false
   impersonate_user: true # here's what I added, and no the import breaks
   extra:
     allows_virtual_table_explore: true
   uuid: 82944780-fbb2-45a9-9450-f1e730a2915b
   version: 1.0.0
   ```
   
   If I create the connection manually and export it, it doesn't contain `impersonate_user: true`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(trino): allow impersonate_user flag to be imported [superset]

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley merged PR #25872:
URL: https://github.com/apache/superset/pull/25872


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(trino): allow impersonate_user flag to be imported [superset]

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #25872:
URL: https://github.com/apache/superset/pull/25872#discussion_r1383741283


##########
superset/models/core.py:
##########
@@ -185,6 +185,7 @@ class Database(
         "is_managed_externally",
         "external_url",
         "encrypted_extra",
+        "impersonate_user"

Review Comment:
   ```suggestion
           "impersonate_user",
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(trino): allow impersonate_user flag to be imported [superset]

Posted by "FGrobelny (via GitHub)" <gi...@apache.org>.
FGrobelny commented on PR #25872:
URL: https://github.com/apache/superset/pull/25872#issuecomment-1847652095

   Hi! Please try 3.0.2 version :) https://github.com/apache/superset/blob/master/CHANGELOG.md#302-mon-nov-20-073838-2023--0500


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org