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/06/25 07:50:10 UTC
[GitHub] [incubator-superset] villebro opened a new pull request #10160: feat: Add new timegrains and convert_dttm to Druid engine spec
villebro opened a new pull request #10160:
URL: https://github.com/apache/incubator-superset/pull/10160
### SUMMARY
Add missing intermediate time grains and `convert_dttm` method to Druid engine spec.
### TEST PLAN
CI + new tests + tested locally
### 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
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] villebro merged pull request #10160: feat: Add new timegrains and convert_dttm to Druid engine spec
Posted by GitBox <gi...@apache.org>.
villebro merged pull request #10160:
URL: https://github.com/apache/incubator-superset/pull/10160
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #10160: feat: Add new timegrains and convert_dttm to Druid engine spec
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #10160:
URL: https://github.com/apache/incubator-superset/pull/10160#discussion_r445375033
##########
File path: superset/db_engine_specs/druid.py
##########
@@ -77,3 +82,12 @@ def get_extra_params(database: "Database") -> Dict[str, Any]:
engine_params["connect_args"] = connect_args
extra["engine_params"] = engine_params
return extra
+
+ @classmethod
+ def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
Review comment:
Good idea
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ktmud commented on a change in pull request #10160: feat: Add new timegrains and convert_dttm to Druid engine spec
Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #10160:
URL: https://github.com/apache/incubator-superset/pull/10160#discussion_r445373625
##########
File path: superset/db_engine_specs/druid.py
##########
@@ -77,3 +82,12 @@ def get_extra_params(database: "Database") -> Dict[str, Any]:
engine_params["connect_args"] = connect_args
extra["engine_params"] = engine_params
return extra
+
+ @classmethod
+ def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
Review comment:
Make this `Enum`?
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #10160: feat: Add new timegrains and convert_dttm to Druid engine spec
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #10160:
URL: https://github.com/apache/incubator-superset/pull/10160#discussion_r445394082
##########
File path: superset/db_engine_specs/druid.py
##########
@@ -41,6 +42,10 @@ class DruidEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
None: "{col}",
"PT1S": "FLOOR({col} TO SECOND)",
"PT1M": "FLOOR({col} TO MINUTE)",
+ "PT5M": "TIME_FLOOR({col}, 'PT5M')",
+ "PT10M": "TIME_FLOOR({col}, 'PT10M')",
+ "PT15M": "TIME_FLOOR({col}, 'PT15M')",
+ "PT0.5H": "TIME_FLOOR({col}, 'PT30M')",
Review comment:
Added the intermediate grains between 1M and 1H.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org