You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/03/20 12:44:14 UTC

[GitHub] [airflow] Rcharriol opened a new pull request #7777: Date_range compatible with schedule_interval

Rcharriol opened a new pull request #7777: Date_range compatible with schedule_interval
URL: https://github.com/apache/airflow/pull/7777
 
 
   Schedule_interval can be a timedelta, a cron expression, or a cron_preset
   And this function just accepted 2 out of those 3, i dont think that's fair for cron_presets
   
   ---
   Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
   
   Make sure to mark the boxes below before creating PR: [x]
   
   - [ ] Description above provides context of the change
   - [ ] Unit tests coverage for changes (not needed for documentation changes)
   - [ ] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [ ] Relevant documentation is updated including usage instructions.
   - [ ] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   

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

[GitHub] [airflow] Rcharriol commented on issue #7777: [AIRFLOW-Date_range compatible with schedule_interval]

Posted by GitBox <gi...@apache.org>.
Rcharriol commented on issue #7777: [AIRFLOW-Date_range compatible with schedule_interval]
URL: https://github.com/apache/airflow/pull/7777#issuecomment-601829143
 
 
   > Can you add a test to avoid regression, please?
   
   My pleasure

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

[GitHub] [airflow] mik-laj commented on issue #7777: [AIRFLOW-Date_range compatible with schedule_interval]

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #7777: [AIRFLOW-Date_range compatible with schedule_interval]
URL: https://github.com/apache/airflow/pull/7777#issuecomment-601687441
 
 
   Can you add tests?

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

[GitHub] [airflow] mik-laj edited a comment on issue #7777: [AIRFLOW-Date_range compatible with schedule_interval]

Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on issue #7777: [AIRFLOW-Date_range compatible with schedule_interval]
URL: https://github.com/apache/airflow/pull/7777#issuecomment-601687441
 
 
   Can you add a test to avoid regression, please?

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

[GitHub] [airflow] mik-laj commented on a change in pull request #7777: [AIRFLOW-Date_range compatible with schedule_interval]

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7777: [AIRFLOW-Date_range compatible with schedule_interval]
URL: https://github.com/apache/airflow/pull/7777#discussion_r395829059
 
 

 ##########
 File path: tests/utils/test_dates.py
 ##########
 @@ -94,3 +94,12 @@ def test_negative_num_given(self):
 
             for i in range(num):
                 self.assertTrue(timezone.is_localized(result[i]))
+
+    def test_delta_cron_presets(self):
+        num = 2
+        for delta in dates.cron_presets:
+            result = dates.date_range(datetime(2016, 1, 1), num=num, delta=delta)
+               self.assertEqual(len(result), num)
 
 Review comment:
   Can you make it more descriptive? You don't have to test all cases. One is enough if it is tested thoroughly.
   https://testing.googleblog.com/2019/12/testing-on-toilet-tests-too-dry-make.html

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