]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Followup / fixup: apply 'black' code formatting to a couple of missed docstrings
authorJames Addison <james@reciperadar.com>
Wed, 26 Apr 2023 20:29:53 +0000 (16:29 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 26 Apr 2023 20:32:02 +0000 (22:32 +0200)
### Description
Follow-up / completion of #1220.  That change updated a number of docstrings within the codebase to use standardised `black` code formatting, but a couple of locations had been missed.

### Checklist

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed

Closes: #1228
Pull-request: https://github.com/sqlalchemy/alembic/pull/1228
Pull-request-sha: f5696b9ca34998e22af5705434ed2393d86e82c0

Change-Id: I5d935b036d6f4e11eb5c229f9982db587d67ae24

alembic/op.pyi
alembic/operations/ops.py
docs/build/unreleased/1220.rst [new file with mode: 0644]

index 229fff32c97eca064c80e4a3356a19158d8b4410..01edb611d6e8db0943c5ccb8e637282c4191dd95 100644 (file)
@@ -667,9 +667,7 @@ def create_primary_key(
 
         from alembic import op
 
-        op.create_primary_key(
-            "pk_my_table", "my_table", ["id", "version"]
-        )
+        op.create_primary_key("pk_my_table", "my_table", ["id", "version"])
 
     This internally generates a :class:`~sqlalchemy.schema.Table` object
     containing the necessary columns, then generates a new
@@ -729,9 +727,10 @@ def create_table(
         from sqlalchemy import Column, TIMESTAMP, func
 
         # specify "DEFAULT NOW" along with the "timestamp" column
-        op.create_table('account',
-            Column('id', INTEGER, primary_key=True),
-            Column('timestamp', TIMESTAMP, server_default=func.now())
+        op.create_table(
+            "account",
+            Column("id", INTEGER, primary_key=True),
+            Column("timestamp", TIMESTAMP, server_default=func.now()),
         )
 
     The function also returns a newly created
index aab45d4cdd2c4f8d939b7eaacc1234921494b855..f95ab70ff2385ebd4f6aeb2bac13dc8aad5888e9 100644 (file)
@@ -308,9 +308,7 @@ class CreatePrimaryKeyOp(AddConstraintOp):
 
             from alembic import op
 
-            op.create_primary_key(
-                "pk_my_table", "my_table", ["id", "version"]
-            )
+            op.create_primary_key("pk_my_table", "my_table", ["id", "version"])
 
         This internally generates a :class:`~sqlalchemy.schema.Table` object
         containing the necessary columns, then generates a new
@@ -1214,9 +1212,10 @@ class CreateTableOp(MigrateOperation):
             from sqlalchemy import Column, TIMESTAMP, func
 
             # specify "DEFAULT NOW" along with the "timestamp" column
-            op.create_table('account',
-                Column('id', INTEGER, primary_key=True),
-                Column('timestamp', TIMESTAMP, server_default=func.now())
+            op.create_table(
+                "account",
+                Column("id", INTEGER, primary_key=True),
+                Column("timestamp", TIMESTAMP, server_default=func.now()),
             )
 
         The function also returns a newly created
diff --git a/docs/build/unreleased/1220.rst b/docs/build/unreleased/1220.rst
new file mode 100644 (file)
index 0000000..74ecaaf
--- /dev/null
@@ -0,0 +1,6 @@
+.. change::
+    :tags: misc
+    :tickets: 1220
+
+    Update code snippets within docstrings to use ``black`` code formatting.
+    Pull request courtesy of James Addison.