uranusjr commented on code in PR #33859:
URL: https://github.com/apache/airflow/pull/33859#discussion_r1308365470
##########
tests/providers/postgres/hooks/test_postgres.py:
##########
@@ -429,8 +429,8 @@ def test_insert_rows_replace(self):
assert commit_count == self.conn.commit.call_count
sql = (
- "INSERT INTO {0} ({1}, {2}) VALUES (%s,%s) "
- "ON CONFLICT ({1}) DO UPDATE SET {2} = excluded.{2}".format(table,
fields[0], fields[1])
+ f"INSERT INTO {table} ({fields[0]}, {fields[1]}) VALUES (%s,%s) "
+ f"ON CONFLICT ({fields[0]}) DO UPDATE SET {fields[1]} =
excluded.{fields[1]}"
Review Comment:
I feel this is where `format()` can be superior to f-string. There are other
cases in this PR I’m not sure f-string is really better.
##########
tests/providers/postgres/hooks/test_postgres.py:
##########
@@ -429,8 +429,8 @@ def test_insert_rows_replace(self):
assert commit_count == self.conn.commit.call_count
sql = (
- "INSERT INTO {0} ({1}, {2}) VALUES (%s,%s) "
- "ON CONFLICT ({1}) DO UPDATE SET {2} = excluded.{2}".format(table,
fields[0], fields[1])
+ f"INSERT INTO {table} ({fields[0]}, {fields[1]}) VALUES (%s,%s) "
+ f"ON CONFLICT ({fields[0]}) DO UPDATE SET {fields[1]} =
excluded.{fields[1]}"
Review Comment:
I feel this is where `format()` can be superior to f-string. There are other
cases in this PR I’m not sure f-string is really better.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]