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

[GitHub] [superset] dpgaspar opened a new pull request, #23769: fix: allow db driver distinction on enforced URI params

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

   ### SUMMARY
   
   Parameters on SQLAlchemy URI vary by driver. Currently connections using "mysql+mysqlconnector" break because the engine spec is enforcing an unknown parameter for this driver.
   
   This PR fixes this issue introducing the driver name to `disallow_uri_query_params` and `enforce_uri_query_params`
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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


[GitHub] [superset] villebro commented on a diff in pull request #23769: fix: allow db driver distinction on enforced URI params

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #23769:
URL: https://github.com/apache/superset/pull/23769#discussion_r1173826620


##########
superset/db_engine_specs/mysql.py:
##########
@@ -175,8 +175,14 @@ class MySQLEngineSpec(BaseEngineSpec, BasicParametersMixin):
             {},
         ),
     }
-    disallow_uri_query_params = {"local_infile"}
-    enforce_uri_query_params = {"local_infile": 0}
+    disallow_uri_query_params = {
+        "mysqldb": {"local_infile"},
+        "mysqlconnector": {"allow_local_infile"},
+    }
+    enforce_uri_query_params = {
+        "mysqldb": {"local_infile": 0},
+        "mysqlconnector": {"allow_local_infile": 0},
+    }

Review Comment:
   thinking out loud: would it be convenient to be able to specify globally disallowed params, too? Something like this:
   ```python
       disallow_uri_query_params = {
           "": {"my_globally_disallowed_param"},
           "mysqldb": {"local_infile"},
           "mysqlconnector": {"allow_local_infile"},
       }
   ```
   (feel free to ignore this idea, as it looks pretty awful 😆)



-- 
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


[GitHub] [superset] dpgaspar merged pull request #23769: fix: allow db driver distinction on enforced URI params

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


-- 
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


[GitHub] [superset] codecov[bot] commented on pull request #23769: fix: allow db driver distinction on enforced URI params

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #23769:
URL: https://github.com/apache/superset/pull/23769#issuecomment-1517913670

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23769?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23769](https://codecov.io/gh/apache/superset/pull/23769?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c0b48e3) into [master](https://codecov.io/gh/apache/superset/commit/0b43112873f984500e7018a0e496cc9bd89bd477?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0b43112) will **decrease** coverage by `11.37%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head c0b48e3 differs from pull request most recent head fc00575. Consider uploading reports for the commit fc00575 to get more accurate results
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #23769       +/-   ##
   ===========================================
   - Coverage   67.87%   56.51%   -11.37%     
   ===========================================
     Files        1924     1924               
     Lines       74379    74381        +2     
     Branches     8106     8106               
   ===========================================
   - Hits        50484    42034     -8450     
   - Misses      21818    30270     +8452     
     Partials     2077     2077               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.84% <62.50%> (-0.01%)` | :arrow_down: |
   | python | `59.10% <100.00%> (-23.56%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `52.72% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/23769?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/23769?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `76.41% <100.00%> (-14.39%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/23769?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `77.64% <100.00%> (-21.18%)` | :arrow_down: |
   
   ... and [300 files with indirect coverage changes](https://codecov.io/gh/apache/superset/pull/23769/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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