[GitHub] [airflow] realradical commented on a change in pull request #8875: [AIRFLOW-8875] fix Dag Run UI execution date with timezone cannot be saved issue

2020-05-18 Thread GitBox


realradical commented on a change in pull request #8875:
URL: https://github.com/apache/airflow/pull/8875#discussion_r426478960



##
File path: tests/www/test_views.py
##
@@ -2601,14 +2601,14 @@ def test_create_dagrun(self):
 
 dr = self.session.query(models.DagRun).one()
 
-self.assertEqual(dr.execution_date, 
timezone.convert_to_utc(datetime(2018, 7, 6, 5, 4, 3)))
+self.assertEqual(dr.execution_date, dt.fromisoformat('2018-07-06 
05:04:03-02:00'))
 
 def test_create_dagrun_valid_conf(self):
 conf_value = dict(Valid=True)
 data = {
 "state": "running",
 "dag_id": "example_bash_operator",
-"execution_date": "2018-07-06 05:05:03",
+"execution_date": "2018-07-06 05:05:03-02:00",

Review comment:
   yeah i poked around on the dag run page, seems like bootstrap JS makes 
sure a timezone is populated which was currently causing the issue





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:
us...@infra.apache.org




[GitHub] [airflow] realradical commented on a change in pull request #8875: [AIRFLOW-8875] fix Dag Run UI execution date with timezone cannot be saved issue

2020-05-17 Thread GitBox


realradical commented on a change in pull request #8875:
URL: https://github.com/apache/airflow/pull/8875#discussion_r426297022



##
File path: airflow/www/forms.py
##
@@ -82,7 +82,8 @@ class DagRunForm(DynamicForm):
 widget=Select2Widget())
 execution_date = DateTimeField(
 lazy_gettext('Execution Date'),
-widget=AirflowDateTimePickerWidget())
+widget=AirflowDateTimePickerWidget(),
+format='%Y-%m-%d %H:%M:%S%z')

Review comment:
   @ashb created a custom field and use Pendulum now. Please check.





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:
us...@infra.apache.org




[GitHub] [airflow] realradical commented on a change in pull request #8875: [AIRFLOW-8875] fix Dag Run UI execution date with timezone cannot be saved issue

2020-05-17 Thread GitBox


realradical commented on a change in pull request #8875:
URL: https://github.com/apache/airflow/pull/8875#discussion_r426287007



##
File path: airflow/www/forms.py
##
@@ -82,7 +82,8 @@ class DagRunForm(DynamicForm):
 widget=Select2Widget())
 execution_date = DateTimeField(
 lazy_gettext('Execution Date'),
-widget=AirflowDateTimePickerWidget())
+widget=AirflowDateTimePickerWidget(),
+format='%Y-%m-%d %H:%M:%S%z')

Review comment:
   @ashb thing is `execution_date ` is a flask field. I am not sure how we 
can make flask use Pendulum.





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:
us...@infra.apache.org




[GitHub] [airflow] realradical commented on a change in pull request #8875: [AIRFLOW-8875] fix Dag Run UI execution date with timezone cannot be saved issue

2020-05-17 Thread GitBox


realradical commented on a change in pull request #8875:
URL: https://github.com/apache/airflow/pull/8875#discussion_r426286484



##
File path: tests/www/test_views.py
##
@@ -2601,14 +2601,14 @@ def test_create_dagrun(self):
 
 dr = self.session.query(models.DagRun).one()
 
-self.assertEqual(dr.execution_date, 
timezone.convert_to_utc(datetime(2018, 7, 6, 5, 4, 3)))
+self.assertEqual(dr.execution_date, dt.fromisoformat('2018-07-06 
05:04:03-02:00'))
 
 def test_create_dagrun_valid_conf(self):
 conf_value = dict(Valid=True)
 data = {
 "state": "running",
 "dag_id": "example_bash_operator",
-"execution_date": "2018-07-06 05:05:03",
+"execution_date": "2018-07-06 05:05:03-02:00",

Review comment:
   I don't think so. correct me if i am wrong





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:
us...@infra.apache.org