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 2022/04/07 19:09:24 UTC
[GitHub] [superset] codemaster08240328 opened a new pull request, #19600: fix: Add 1 month to quaterly time grain
codemaster08240328 opened a new pull request, #19600:
URL: https://github.com/apache/superset/pull/19600
<!---
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 -->
Before this change, we are facing wrong Q1, Q2, Q3, Q4 duration.
It should be
Q1: Jan - Mar
Q2: Apr - Jun
Q3: Jul - Sep
Q4: Oct - Dec
The reason is that time grain expression against database returns date as the first date of each quarter. (e.g.: Q1: 1st Jan, Q2: 1st Apr). But when we visualize this data using time_series bar chart v2, the returned date is the middle date of the bar chart.
Solution: added 1 month to time grain expression for each database.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
Before:
<img width="1530" alt="image" src="https://user-images.githubusercontent.com/39701522/162277520-07970d5f-94a6-4648-9d51-2e845a9ef85f.png">
After:
<img width="1532" alt="image" src="https://user-images.githubusercontent.com/39701522/162277294-94e264e6-04f8-4f51-b912-7022a50393c9.png">
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
1. Chart a time series V2 chart using netflix demo data
Time: Date added grain as day
Metric: Count
Time range: 01/01/2019 - 01/01/2020
2. Run graph
3. Toggle to “Quarter” time grain
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [x] Bug fix
--
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] yousoph commented on pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
yousoph commented on PR #19600:
URL: https://github.com/apache/superset/pull/19600#issuecomment-1092125864
/testenv up
--
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] zhaoyongjie commented on a diff in pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on code in PR #19600:
URL: https://github.com/apache/superset/pull/19600#discussion_r845705862
##########
superset/db_engine_specs/netezza.py:
##########
@@ -31,7 +31,7 @@ class NetezzaEngineSpec(PostgresBaseEngineSpec):
"P1D": "DATE_TRUNC('day', {col})",
"P1W": "DATE_TRUNC('week', {col})",
"P1M": "DATE_TRUNC('month', {col})",
- "P3M": "DATE_TRUNC('quarter', {col})",
+ "P3M": "ADD_MONTHS(DATE_TRUNC('quarter', {col}), 1)",
Review Comment:
This is a breaking change, and I don't think a quarter plus 1 mouth is a correct solution.
--
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] zhaoyongjie commented on a diff in pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on code in PR #19600:
URL: https://github.com/apache/superset/pull/19600#discussion_r845705862
##########
superset/db_engine_specs/netezza.py:
##########
@@ -31,7 +31,7 @@ class NetezzaEngineSpec(PostgresBaseEngineSpec):
"P1D": "DATE_TRUNC('day', {col})",
"P1W": "DATE_TRUNC('week', {col})",
"P1M": "DATE_TRUNC('month', {col})",
- "P3M": "DATE_TRUNC('quarter', {col})",
+ "P3M": "ADD_MONTHS(DATE_TRUNC('quarter', {col}), 1)",
Review Comment:
This is a breaking change, and I don't think a quarter plus 1 month is a correct solution.
--
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] github-actions[bot] commented on pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19600:
URL: https://github.com/apache/superset/pull/19600#issuecomment-1092127703
@yousoph Ephemeral environment spinning up at http://34.221.60.255:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
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] prosdev0107 commented on pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on PR #19600:
URL: https://github.com/apache/superset/pull/19600#issuecomment-1092114945
LGTM
--
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 #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #19600:
URL: https://github.com/apache/superset/pull/19600#issuecomment-1092111289
# [Codecov](https://codecov.io/gh/apache/superset/pull/19600?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 [#19600](https://codecov.io/gh/apache/superset/pull/19600?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9bdce42) into [master](https://codecov.io/gh/apache/superset/commit/f91f83d011b4c83576f5fff76d502f5616f2972d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f91f83d) will **decrease** coverage by `12.91%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #19600 +/- ##
===========================================
- Coverage 66.65% 53.74% -12.92%
===========================================
Files 1680 1680
Lines 64292 64292
Branches 6564 6564
===========================================
- Hits 42854 34552 -8302
- Misses 19736 28038 +8302
Partials 1702 1702
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.50% <ø> (ø)` | |
| python | `56.10% <ø> (-26.28%)` | :arrow_down: |
| sqlite | `?` | |
| unit | `47.23% <ø> (?)` | |
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/19600?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/netezza.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL25ldGV6emEucHk=) | `88.88% <ø> (ø)` | |
| [superset/db\_engine\_specs/oracle.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL29yYWNsZS5weQ==) | `57.57% <ø> (-36.37%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/superset/pull/19600/diff?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) | `60.90% <ø> (-36.37%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/19600/diff?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==) | `39.54% <ø> (-49.49%)` | :arrow_down: |
| [superset/db\_engine\_specs/rockset.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3JvY2tzZXQucHk=) | `53.12% <ø> (ø)` | |
| [superset/db\_engine\_specs/snowflake.py](https://codecov.io/gh/apache/superset/pull/19600/diff?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==) | `76.31% <ø> (ø)` | |
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `91.89% <ø> (-5.41%)` | :arrow_down: |
| [superset/db\_engine\_specs/trino.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3RyaW5vLnB5) | `38.39% <ø> (-33.04%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/key\_value/commands/upsert.py](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL3Vwc2VydC5weQ==) | `0.00% <0.00%> (-89.59%)` | :arrow_down: |
| ... and [274 more](https://codecov.io/gh/apache/superset/pull/19600/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19600?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19600?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f91f83d...9bdce42](https://codecov.io/gh/apache/superset/pull/19600?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] github-actions[bot] commented on pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19600:
URL: https://github.com/apache/superset/pull/19600#issuecomment-1095275098
Ephemeral environment shutdown and build artifacts deleted.
--
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] rusackas closed pull request #19600: fix: Add 1 month to quaterly time grain
Posted by GitBox <gi...@apache.org>.
rusackas closed pull request #19600: fix: Add 1 month to quaterly time grain
URL: https://github.com/apache/superset/pull/19600
--
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