You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/02/04 04:11:24 UTC

[GitHub] [incubator-superset] john-bodley opened a new pull request #9082: [fix] Issue with previously defined SQL configuration

john-bodley opened a new pull request #9082: [fix] Issue with previously defined SQL configuration
URL: https://github.com/apache/incubator-superset/pull/9082
 
 
   ### CATEGORY
   
   Choose one
   
   - [x] Bug Fix
   - [ ] Enhancement (new features, refinement)
   - [ ] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   
   The `get_sqla_engine` method which mutates the URL overrides  the `configuration` key within the SQLAlchemy `connect_args` params rather than updating it. This means that any database specific configuration options are simply ignored. 
   
   This PR ensures that the configuration is updated rather than overridden. 
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TEST PLAN
   
   Test locally on a Hive database and verified that PyHive was receiving the correct configuration.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   
   to: @etr2460 @michellethomas @mistercrunch @villebro 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] john-bodley merged pull request #9082: [fix] Issue with previously defined SQL configuration

Posted by GitBox <gi...@apache.org>.
john-bodley merged pull request #9082: [fix] Issue with previously defined SQL configuration
URL: https://github.com/apache/incubator-superset/pull/9082
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] codecov-io edited a comment on issue #9082: [fix] Issue with previously defined SQL configuration

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #9082: [fix] Issue with previously defined SQL configuration
URL: https://github.com/apache/incubator-superset/pull/9082#issuecomment-581736101
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=h1) Report
   > Merging [#9082](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/540df268c286d454ad3980f5c38a972d2163344f?src=pr&el=desc) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9082/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #9082   +/-   ##
   =======================================
     Coverage   59.45%   59.45%           
   =======================================
     Files         369      369           
     Lines       11752    11752           
     Branches     2889     2889           
   =======================================
     Hits         6987     6987           
     Misses       4586     4586           
     Partials      179      179
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=footer). Last update [540df26...b2924f7](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] john-bodley commented on a change in pull request #9082: [fix] Issue with previously defined SQL configuration

Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #9082: [fix] Issue with previously defined SQL configuration
URL: https://github.com/apache/incubator-superset/pull/9082#discussion_r374466253
 
 

 ##########
 File path: superset/models/core.py
 ##########
 @@ -297,24 +297,26 @@ def get_sqla_engine(
         if nullpool:
             params["poolclass"] = NullPool
 
+        connect_args = params.get("connect_args", {})
+
         # If using Hive, this will set hive.server2.proxy.user=$effective_username
-        configuration: Dict[str, Any] = {}
+        configuration = connect_args.get("configuration", {})
         configuration.update(
             self.db_engine_spec.get_configuration_for_impersonation(
                 str(sqlalchemy_url), self.impersonate_user, effective_username
             )
         )
         if configuration:
-            d = params.get("connect_args", {})
-            d["configuration"] = configuration
-            params["connect_args"] = d
+            connect_args["configuration"] = configuration
 
 Review comment:
   I simply renamed `d` to the more descriptive `connect_args`. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] codecov-io commented on issue #9082: [fix] Issue with previously defined SQL configuration

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9082: [fix] Issue with previously defined SQL configuration
URL: https://github.com/apache/incubator-superset/pull/9082#issuecomment-581736101
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=h1) Report
   > Merging [#9082](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/540df268c286d454ad3980f5c38a972d2163344f?src=pr&el=desc) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9082/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #9082   +/-   ##
   =======================================
     Coverage   59.45%   59.45%           
   =======================================
     Files         369      369           
     Lines       11752    11752           
     Branches     2889     2889           
   =======================================
     Hits         6987     6987           
     Misses       4586     4586           
     Partials      179      179
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=footer). Last update [540df26...a2b0586](https://codecov.io/gh/apache/incubator-superset/pull/9082?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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