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 2021/01/18 10:21:34 UTC

[GitHub] [airflow] XD-DENG commented on a change in pull request #13732: Switch to f-strings using flynt.

XD-DENG commented on a change in pull request #13732:
URL: https://github.com/apache/airflow/pull/13732#discussion_r559458200



##########
File path: airflow/models/dag.py
##########
@@ -1538,7 +1538,7 @@ def pickle_info(self):
             dttm = timezone.utcnow()
             pickled = pickle.dumps(self)
             d['pickle_len'] = len(pickled)
-            d['pickling_duration'] = "{}".format(timezone.utcnow() - dttm)
+            d['pickling_duration'] = f"{timezone.utcnow() - dttm}"

Review comment:
       Here using `str(timezone.utcnow() - dttm})` may make more sense than f"{timezone.utcnow() - dttm}" IMO, given it's purely a type conversion rather than formating.

##########
File path: airflow/cli/commands/dag_command.py
##########
@@ -166,7 +166,7 @@ def set_is_paused(is_paused, args):
         is_paused=is_paused,
     )
 
-    print("Dag: {}, paused: {}".format(args.dag_id, str(is_paused)))
+    print(f"Dag: {args.dag_id}, paused: {str(is_paused)}")

Review comment:
       nit: the `str()` can be removed?




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