You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2023/03/16 22:09:28 UTC

[GitHub] [superset] betodealmeida opened a new pull request, #23401: feat(postgresql): dynamic schema

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   Builds on https://github.com/apache/superset/pull/23385. Modifies the `adjust_database_uri` to accept `connect_args` as well, so we can implement dynamic schema in Postgres.
   
   ### 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] eschutho commented on a diff in pull request #23401: feat(postgresql): dynamic schema

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


##########
superset/db_engine_specs/base.py:
##########
@@ -1057,30 +1057,33 @@ def extract_errors(
         ]
 
     @classmethod
-    def adjust_database_uri(  # pylint: disable=unused-argument
+    def adjust_engine_params(  # pylint: disable=unused-argument
         cls,
         uri: URL,
-        selected_schema: Optional[str],
-    ) -> URL:
+        connect_args: Dict[str, Any],
+        catalog: Optional[str],
+        schema: Optional[str],

Review Comment:
   I noticed that in some of the class overrides, catalog and schema have kwargs with defaults instead of positional arguments. Do we want to be consistent?



-- 
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] eschutho commented on a diff in pull request #23401: feat(postgresql): dynamic schema

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


##########
superset/db_engine_specs/base.py:
##########
@@ -1057,30 +1057,33 @@ def extract_errors(
         ]
 
     @classmethod
-    def adjust_database_uri(  # pylint: disable=unused-argument
+    def adjust_engine_params(  # pylint: disable=unused-argument

Review Comment:
   @betodealmeida what do you think will be the impact of this change on any custom db engine specs that have been added to Superset instances?



-- 
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] eschutho commented on a diff in pull request #23401: feat(postgresql): dynamic schema

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


##########
superset/db_engine_specs/base.py:
##########
@@ -1057,30 +1057,33 @@ def extract_errors(
         ]
 
     @classmethod
-    def adjust_database_uri(  # pylint: disable=unused-argument
+    def adjust_engine_params(  # pylint: disable=unused-argument

Review Comment:
   oh, nm, I see how you covered this below. 



-- 
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 #23401: feat(postgresql): dynamic schema

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

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23401?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 [#23401](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3ade02e) into [default_schema](https://codecov.io/gh/apache/superset/commit/8e04ad8a22dce50645199d5fad148dc9d15cbb3e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8e04ad8) will **decrease** coverage by `11.31%`.
   > The diff coverage is `65.30%`.
   
   > :exclamation: Current head 3ade02e differs from pull request most recent head 05b1e7e. Consider uploading reports for the commit 05b1e7e to get more accurate results
   
   ```diff
   @@                 Coverage Diff                 @@
   ##           default_schema   #23401       +/-   ##
   ===================================================
   - Coverage           67.55%   56.25%   -11.31%     
   ===================================================
     Files                1907     1907               
     Lines               73546    73552        +6     
     Branches             7976     7976               
   ===================================================
   - Hits                49687    41376     -8311     
   - Misses              21810    30127     +8317     
     Partials             2049     2049               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.68% <40.81%> (-0.01%)` | :arrow_down: |
   | python | `58.93% <65.30%> (-23.38%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `52.52% <57.14%> (+<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/23401?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/snowflake.py](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Nub3dmbGFrZS5weQ==) | `66.86% <14.28%> (ø)` | |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `33.89% <25.00%> (-53.90%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/23401?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) | `74.69% <25.00%> (-24.10%)` | :arrow_down: |
   | [superset/db\_engine\_specs/drill.py](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2RyaWxsLnB5) | `88.88% <40.00%> (ø)` | |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `46.33% <83.33%> (-41.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `71.31% <93.33%> (-25.44%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/23401?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.11% <100.00%> (-14.69%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/23401?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `76.63% <100.00%> (-13.48%)` | :arrow_down: |
   
   ... and [295 files with indirect coverage changes](https://codecov.io/gh/apache/superset/pull/23401/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


[GitHub] [superset] betodealmeida commented on a diff in pull request #23401: feat(postgresql): dynamic schema

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


##########
superset/db_engine_specs/base.py:
##########
@@ -1057,30 +1057,33 @@ def extract_errors(
         ]
 
     @classmethod
-    def adjust_database_uri(  # pylint: disable=unused-argument
+    def adjust_engine_params(  # pylint: disable=unused-argument
         cls,
         uri: URL,
-        selected_schema: Optional[str],
-    ) -> URL:
+        connect_args: Dict[str, Any],
+        catalog: Optional[str],
+        schema: Optional[str],

Review Comment:
   Ah, good point, let me add defaults here.



-- 
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] feat(postgresql): dynamic schema [superset]

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

   ok, so looks like we encounter a problem with apache drill (with mongo underneath). `USE mongo.aut` is now being turned to `USE mongo%2Faut` and causing things to fail.
   
   Will open a discussion in slack to see how we might resolve this.


-- 
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] eschutho commented on a diff in pull request #23401: feat(postgresql): dynamic schema

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


##########
superset/db_engine_specs/base.py:
##########
@@ -1057,30 +1057,33 @@ def extract_errors(
         ]
 
     @classmethod
-    def adjust_database_uri(  # pylint: disable=unused-argument
+    def adjust_engine_params(  # pylint: disable=unused-argument
         cls,
         uri: URL,
-        selected_schema: Optional[str],
-    ) -> URL:
+        connect_args: Dict[str, Any],
+        catalog: Optional[str],
+        schema: Optional[str],

Review Comment:
   I noticed that in some of the class overrides, catalog and schema have kwargs with defaults. Do we want to be consistent?



-- 
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] betodealmeida merged pull request #23401: feat(postgresql): dynamic schema

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


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