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 2021/07/22 23:24:22 UTC
[GitHub] [superset] eschutho opened a new pull request #15849: feat: add timezones to report cron
eschutho opened a new pull request #15849:
URL: https://github.com/apache/superset/pull/15849
### SUMMARY
We have a new column on the reports_schedule table that defaults timezone to "UTC". This pr reads that timezone from the report and then runs the cron schedule according to that schedule. In a future PR I will add in a UI that allows users to change that timezone and save different values to the reports_schedule table, such as "America/New_York" or "America/Los_Angeles"
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
We want to make sure that all existing reports continue to run on UTC. To test, create a report and make sure that it runs at the appropriate time.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] 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 change in pull request #15849: feat: add timezones to report cron
Posted by GitBox <gi...@apache.org>.
eschutho commented on a change in pull request #15849:
URL: https://github.com/apache/superset/pull/15849#discussion_r677613512
##########
File path: tests/integration_tests/reports/api_tests.py
##########
@@ -674,6 +676,61 @@ def test_create_report_schedule_schema(self):
rv = self.client.post(uri, json=report_schedule_data)
assert rv.status_code == 201
+ # Test that report cannot be created with null timezone
+ report_schedule_data = {
+ "type": ReportScheduleType.ALERT,
+ "name": "new5",
+ "description": "description",
+ "creation_method": ReportCreationMethodType.ALERTS_REPORTS,
+ "crontab": "0 9 * * *",
+ "recipients": [
+ {
+ "type": ReportRecipientType.EMAIL,
+ "recipient_config_json": {"target": "target@superset.org"},
+ },
+ {
+ "type": ReportRecipientType.SLACK,
+ "recipient_config_json": {"target": "channel"},
+ },
+ ],
+ "working_timeout": 3600,
+ "timezone": None,
+ "dashboard": dashboard.id,
+ "database": example_db.id,
+ }
+ rv = self.client.post(uri, json=report_schedule_data)
+ assert rv.status_code == 400
+ data = json.loads(rv.data.decode("utf-8"))
+ assert data == {"message": {"timezone": ["Field may not be null."]}}
Review comment:
do you think because it's a negative assertion instead of the positive ones?
--
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] edited a comment on pull request #15849: feat: add timezones to report cron
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #15849:
URL: https://github.com/apache/superset/pull/15849#issuecomment-887929255
# [Codecov](https://codecov.io/gh/apache/superset/pull/15849?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 [#15849](https://codecov.io/gh/apache/superset/pull/15849?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d6ba5e5) into [master](https://codecov.io/gh/apache/superset/commit/9c854ff1f1ab80b26438a3b6d91ca9b44b5f2a7a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9c854ff) will **decrease** coverage by `0.28%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/15849/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/15849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #15849 +/- ##
==========================================
- Coverage 77.09% 76.81% -0.29%
==========================================
Files 984 986 +2
Lines 51782 51872 +90
Branches 7028 7028
==========================================
- Hits 39920 39843 -77
- Misses 11637 11804 +167
Partials 225 225
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `81.40% <100.00%> (-0.13%)` | :arrow_down: |
| postgres | `81.43% <100.00%> (-0.13%)` | :arrow_down: |
| presto | `?` | |
| python | `81.51% <100.00%> (-0.57%)` | :arrow_down: |
| sqlite | `81.06% <100.00%> (-0.13%)` | :arrow_down: |
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/15849?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/reports/api.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvcmVwb3J0cy9hcGkucHk=) | `87.78% <ø> (ø)` | |
| [superset/models/reports.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvbW9kZWxzL3JlcG9ydHMucHk=) | `100.00% <100.00%> (ø)` | |
| [superset/reports/schemas.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvcmVwb3J0cy9zY2hlbWFzLnB5) | `98.76% <100.00%> (+0.04%)` | :arrow_up: |
| [superset/tasks/cron\_util.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvdGFza3MvY3Jvbl91dGlsLnB5) | `100.00% <100.00%> (ø)` | |
| [superset/tasks/scheduler.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvdGFza3Mvc2NoZWR1bGVyLnB5) | `67.44% <100.00%> (-7.11%)` | :arrow_down: |
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-82.15%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.80% <0.00%> (-16.71%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/15849/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==) | `83.47% <0.00%> (-6.43%)` | :arrow_down: |
| [superset/commands/importers/v1/examples.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2V4YW1wbGVzLnB5) | `38.02% <0.00%> (-2.28%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
| ... and [25 more](https://codecov.io/gh/apache/superset/pull/15849/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/15849?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/15849?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 [9c854ff...d6ba5e5](https://codecov.io/gh/apache/superset/pull/15849?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] eschutho merged pull request #15849: feat: add timezones to report cron
Posted by GitBox <gi...@apache.org>.
eschutho merged pull request #15849:
URL: https://github.com/apache/superset/pull/15849
--
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 #15849: feat: add timezones to report cron
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #15849:
URL: https://github.com/apache/superset/pull/15849#issuecomment-887929255
# [Codecov](https://codecov.io/gh/apache/superset/pull/15849?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 [#15849](https://codecov.io/gh/apache/superset/pull/15849?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d6ba5e5) into [master](https://codecov.io/gh/apache/superset/commit/9c854ff1f1ab80b26438a3b6d91ca9b44b5f2a7a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9c854ff) will **decrease** coverage by `0.28%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/15849/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/15849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #15849 +/- ##
==========================================
- Coverage 77.09% 76.81% -0.29%
==========================================
Files 984 986 +2
Lines 51782 51872 +90
Branches 7028 7028
==========================================
- Hits 39920 39843 -77
- Misses 11637 11804 +167
Partials 225 225
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `81.40% <100.00%> (-0.13%)` | :arrow_down: |
| postgres | `81.43% <100.00%> (-0.13%)` | :arrow_down: |
| presto | `?` | |
| python | `81.51% <100.00%> (-0.57%)` | :arrow_down: |
| sqlite | `81.06% <100.00%> (-0.13%)` | :arrow_down: |
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/15849?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/reports/api.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvcmVwb3J0cy9hcGkucHk=) | `87.78% <ø> (ø)` | |
| [superset/models/reports.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvbW9kZWxzL3JlcG9ydHMucHk=) | `100.00% <100.00%> (ø)` | |
| [superset/reports/schemas.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvcmVwb3J0cy9zY2hlbWFzLnB5) | `98.76% <100.00%> (+0.04%)` | :arrow_up: |
| [superset/tasks/cron\_util.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvdGFza3MvY3Jvbl91dGlsLnB5) | `100.00% <100.00%> (ø)` | |
| [superset/tasks/scheduler.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvdGFza3Mvc2NoZWR1bGVyLnB5) | `67.44% <100.00%> (-7.11%)` | :arrow_down: |
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-82.15%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.80% <0.00%> (-16.71%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/15849/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==) | `83.47% <0.00%> (-6.43%)` | :arrow_down: |
| [superset/commands/importers/v1/examples.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL2V4YW1wbGVzLnB5) | `38.02% <0.00%> (-2.28%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/15849/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
| ... and [25 more](https://codecov.io/gh/apache/superset/pull/15849/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/15849?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/15849?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 [9c854ff...d6ba5e5](https://codecov.io/gh/apache/superset/pull/15849?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] hughhhh commented on a change in pull request #15849: feat: add timezones to report cron
Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #15849:
URL: https://github.com/apache/superset/pull/15849#discussion_r677602211
##########
File path: tests/integration_tests/reports/api_tests.py
##########
@@ -674,6 +676,61 @@ def test_create_report_schedule_schema(self):
rv = self.client.post(uri, json=report_schedule_data)
assert rv.status_code == 201
+ # Test that report cannot be created with null timezone
+ report_schedule_data = {
+ "type": ReportScheduleType.ALERT,
+ "name": "new5",
+ "description": "description",
+ "creation_method": ReportCreationMethodType.ALERTS_REPORTS,
+ "crontab": "0 9 * * *",
+ "recipients": [
+ {
+ "type": ReportRecipientType.EMAIL,
+ "recipient_config_json": {"target": "target@superset.org"},
+ },
+ {
+ "type": ReportRecipientType.SLACK,
+ "recipient_config_json": {"target": "channel"},
+ },
+ ],
+ "working_timeout": 3600,
+ "timezone": None,
+ "dashboard": dashboard.id,
+ "database": example_db.id,
+ }
+ rv = self.client.post(uri, json=report_schedule_data)
+ assert rv.status_code == 400
+ data = json.loads(rv.data.decode("utf-8"))
+ assert data == {"message": {"timezone": ["Field may not be null."]}}
Review comment:
nit: write this as a separate test
--
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] hughhhh commented on a change in pull request #15849: feat: add timezones to report cron
Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #15849:
URL: https://github.com/apache/superset/pull/15849#discussion_r677602211
##########
File path: tests/integration_tests/reports/api_tests.py
##########
@@ -674,6 +676,61 @@ def test_create_report_schedule_schema(self):
rv = self.client.post(uri, json=report_schedule_data)
assert rv.status_code == 201
+ # Test that report cannot be created with null timezone
+ report_schedule_data = {
+ "type": ReportScheduleType.ALERT,
+ "name": "new5",
+ "description": "description",
+ "creation_method": ReportCreationMethodType.ALERTS_REPORTS,
+ "crontab": "0 9 * * *",
+ "recipients": [
+ {
+ "type": ReportRecipientType.EMAIL,
+ "recipient_config_json": {"target": "target@superset.org"},
+ },
+ {
+ "type": ReportRecipientType.SLACK,
+ "recipient_config_json": {"target": "channel"},
+ },
+ ],
+ "working_timeout": 3600,
+ "timezone": None,
+ "dashboard": dashboard.id,
+ "database": example_db.id,
+ }
+ rv = self.client.post(uri, json=report_schedule_data)
+ assert rv.status_code == 400
+ data = json.loads(rv.data.decode("utf-8"))
+ assert data == {"message": {"timezone": ["Field may not be null."]}}
Review comment:
nit: write this as a seperate test
--
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