Skip to content

Commit 4ff2370

Browse files
authored
refactor: change warning logs to debug logs for column checks in Alembic migration (#10154)
Updated logging levels from warning to debug for 'created_at' and 'updated_at' column checks in the Alembic migration script. This change aims to reduce log noise while maintaining visibility into the migration process.
1 parent e84522d commit 4ff2370

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/backend/base/langflow/alembic/versions/4e5980a44eaa_fix_date_times_again.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Fix date times again
1+
"""Fix date times again.
22
33
Revision ID: 4e5980a44eaa
44
Revises: 79e675cb6752
@@ -22,7 +22,7 @@
2222

2323
def upgrade() -> None:
2424
conn = op.get_bind()
25-
inspector = sa.inspect(conn) # type: ignore
25+
inspector = sa.inspect(conn)
2626
table_names = inspector.get_table_names()
2727
# ### commands auto generated by Alembic - please adjust! ###
2828
if "apikey" in table_names:
@@ -37,9 +37,9 @@ def upgrade() -> None:
3737
existing_nullable=False,
3838
)
3939
elif created_at_column is None:
40-
logger.warning("Column 'created_at' not found in table 'apikey'")
40+
logger.debug("Column 'created_at' not found in table 'apikey'")
4141
else:
42-
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'apikey'")
42+
logger.debug(f"Column 'created_at' has type {created_at_column['type']} in table 'apikey'")
4343
if "variable" in table_names:
4444
columns = inspector.get_columns("variable")
4545
created_at_column = next((column for column in columns if column["name"] == "created_at"), None)
@@ -53,9 +53,9 @@ def upgrade() -> None:
5353
existing_nullable=True,
5454
)
5555
elif created_at_column is None:
56-
logger.warning("Column 'created_at' not found in table 'variable'")
56+
logger.debug("Column 'created_at' not found in table 'variable'")
5757
else:
58-
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'variable'")
58+
logger.debug(f"Column 'created_at' has type {created_at_column['type']} in table 'variable'")
5959
if updated_at_column is not None and isinstance(updated_at_column["type"], postgresql.TIMESTAMP):
6060
batch_op.alter_column(
6161
"updated_at",
@@ -64,16 +64,16 @@ def upgrade() -> None:
6464
existing_nullable=True,
6565
)
6666
elif updated_at_column is None:
67-
logger.warning("Column 'updated_at' not found in table 'variable'")
67+
logger.debug("Column 'updated_at' not found in table 'variable'")
6868
else:
69-
logger.warning(f"Column 'updated_at' has type {updated_at_column['type']} in table 'variable'")
69+
logger.debug(f"Column 'updated_at' has type {updated_at_column['type']} in table 'variable'")
7070

7171
# ### end Alembic commands ###
7272

7373

7474
def downgrade() -> None:
7575
conn = op.get_bind()
76-
inspector = sa.inspect(conn) # type: ignore
76+
inspector = sa.inspect(conn)
7777
table_names = inspector.get_table_names()
7878
# ### commands auto generated by Alembic - please adjust! ###
7979
if "variable" in table_names:
@@ -89,9 +89,9 @@ def downgrade() -> None:
8989
existing_nullable=True,
9090
)
9191
elif updated_at_column is None:
92-
logger.warning("Column 'updated_at' not found in table 'variable'")
92+
logger.debug("Column 'updated_at' not found in table 'variable'")
9393
else:
94-
logger.warning(f"Column 'updated_at' has type {updated_at_column['type']} in table 'variable'")
94+
logger.debug(f"Column 'updated_at' has type {updated_at_column['type']} in table 'variable'")
9595
if created_at_column is not None and isinstance(created_at_column["type"], sa.DateTime):
9696
batch_op.alter_column(
9797
"created_at",
@@ -100,9 +100,9 @@ def downgrade() -> None:
100100
existing_nullable=True,
101101
)
102102
elif created_at_column is None:
103-
logger.warning("Column 'created_at' not found in table 'variable'")
103+
logger.debug("Column 'created_at' not found in table 'variable'")
104104
else:
105-
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'variable'")
105+
logger.debug(f"Column 'created_at' has type {created_at_column['type']} in table 'variable'")
106106

107107
if "apikey" in table_names:
108108
columns = inspector.get_columns("apikey")
@@ -116,8 +116,8 @@ def downgrade() -> None:
116116
existing_nullable=False,
117117
)
118118
elif created_at_column is None:
119-
logger.warning("Column 'created_at' not found in table 'apikey'")
119+
logger.debug("Column 'created_at' not found in table 'apikey'")
120120
else:
121-
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'apikey'")
121+
logger.debug(f"Column 'created_at' has type {created_at_column['type']} in table 'apikey'")
122122

123123
# ### end Alembic commands ###

0 commit comments

Comments
 (0)