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/03/23 21:58:43 UTC

[GitHub] [incubator-superset] bkyryliuk opened a new pull request #9353: Implement dttm config

bkyryliuk opened a new pull request #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353
 
 
   ### CATEGORY
   
   Choose one
   
   - [ ] Bug Fix
   - [ X] Enhancement (new features, refinement)
   - [ ] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   Provides an ability for the superset admin to configure the date time columns per name so they will be automatically created on the table creation.
   It helps a lot for the companies that have conventions & automatic day columns. 
   
   ### TEST PLAN
   * unit tests
   * tested in DBX production over last quarter
   
   ### 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
   

----------------------------------------------------------------
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] mistercrunch commented on a change in pull request #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on a change in pull request #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#discussion_r396919888
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -1073,7 +1073,7 @@ def mutator(df: pd.DataFrame) -> None:
     def get_sqla_table_object(self) -> Table:
         return self.database.get_table(self.table_name, schema=self.schema)
 
-    def fetch_metadata(self) -> None:
+    def fetch_metadata(self, dttm_config={}) -> None:
 
 Review comment:
   Using mutable default args in python is a common gotcha https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments

----------------------------------------------------------------
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 #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#issuecomment-602991312
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=h1) Report
   > Merging [#9353](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/232925b7bf0e2ffbe23029a77a97223663830968&el=desc) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9353/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #9353      +/-   ##
   ==========================================
   + Coverage   58.96%   58.97%   +0.01%     
   ==========================================
     Files         374      374              
     Lines       12137    12124      -13     
     Branches     2992     2987       -5     
   ==========================================
   - Hits         7156     7150       -6     
   + Misses       4802     4795       -7     
     Partials      179      179              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/chart/ChartRenderer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9353/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0UmVuZGVyZXIuanN4) | `40.29% <0.00%> (-0.96%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9353?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/9353?src=pr&el=footer). Last update [232925b...75c96b9](https://codecov.io/gh/apache/incubator-superset/pull/9353?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] villebro commented on a change in pull request #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#discussion_r399215676
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -1073,8 +1083,34 @@ def mutator(df: pd.DataFrame) -> None:
     def get_sqla_table_object(self) -> Table:
         return self.database.get_table(self.table_name, schema=self.schema)
 
-    def fetch_metadata(self, commit=True) -> None:
+    def fetch_metadata(
+        self,
+        commit=True,
+        dttm_config: Optional[Dict[str, Dict[str, str]]] = None,
+        main_dttm_col: Optional[str] = None,
+    ) -> None:
 
 Review comment:
   Is there some reason why the signature is modified? It appears we could just as easily pick up the config params here instead of passing them from `views.py`

----------------------------------------------------------------
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 issue #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
john-bodley commented on issue #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#issuecomment-605557693
 
 
   @bkyryliuk we have somewhat similar logic as part of SIP-15 which is defined at the database level per [here](https://github.com/apache/incubator-superset/blob/499f9c8fca3ea01b7f7eeb977531669518c5dc4b/docs/installation.rst#sip-15). It seems maybe these concepts should be merged. 

----------------------------------------------------------------
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] bkyryliuk commented on issue #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
bkyryliuk commented on issue #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#issuecomment-603519410
 
 
   @mistercrunch thanks for the feedback, resolved the comments & added main dttm configuration in addition to that

----------------------------------------------------------------
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] bkyryliuk commented on issue #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
bkyryliuk commented on issue #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#issuecomment-607590123
 
 
   Closing in favor of: https://github.com/apache/incubator-superset/pull/9444

----------------------------------------------------------------
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] bkyryliuk commented on issue #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
bkyryliuk commented on issue #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#issuecomment-606157072
 
 
   Thanks @john-bodley - I'll modify the db config instead - will have a PR soon

----------------------------------------------------------------
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] bkyryliuk commented on a change in pull request #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
bkyryliuk commented on a change in pull request #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#discussion_r399396469
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -1073,8 +1083,34 @@ def mutator(df: pd.DataFrame) -> None:
     def get_sqla_table_object(self) -> Table:
         return self.database.get_table(self.table_name, schema=self.schema)
 
-    def fetch_metadata(self, commit=True) -> None:
+    def fetch_metadata(
+        self,
+        commit=True,
+        dttm_config: Optional[Dict[str, Dict[str, str]]] = None,
+        main_dttm_col: Optional[str] = None,
+    ) -> None:
 
 Review comment:
   @villebro I have a slight preference towards a very lightweight model classes and not to depend on the superset app. A middle ground could be here to move this function outside of the models

----------------------------------------------------------------
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] bkyryliuk closed pull request #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
bkyryliuk closed pull request #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353
 
 
   

----------------------------------------------------------------
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 #9353: Implement dttm config

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #9353: Implement dttm config
URL: https://github.com/apache/incubator-superset/pull/9353#issuecomment-602991312
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=h1) Report
   > Merging [#9353](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/06e0f04214bd7866328c6714687eaeffafc44f70&el=desc) will **not change** coverage by `%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9353/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9353?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #9353   +/-   ##
   =======================================
     Coverage   59.00%   59.00%           
   =======================================
     Files         374      374           
     Lines       12136    12136           
     Branches     2989     2989           
   =======================================
     Hits         7161     7161           
     Misses       4796     4796           
     Partials      179      179           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9353?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/9353?src=pr&el=footer). Last update [06e0f04...9a5013d](https://codecov.io/gh/apache/incubator-superset/pull/9353?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