-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Dockerfiles to include user creation and use --user flag for pip install * Add JavaScriptMIMETypeMiddleware to main.py * Update constants.py and run.py files * Update package versions in poetry.lock and pyproject.toml files * Refactor Dockerfile to optimize image building process * Fix import error in main.py * Update Dockerfiles to use logspace/langflow image * Fix decryption error handling in get_user_store_api_key function * Add error logging to JavaScriptMIMETypeMiddleware in main.py * Fix error logging in main.py * Fix error logging and datetime type in database migrations * Update openai component * Update package versions for boto3 and botocore
- Loading branch information
1 parent
7022c81
commit 23f374d
Showing
13 changed files
with
162 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "langflow" | ||
version = "1.0.0a20" | ||
version = "1.0.0a21" | ||
description = "A Python package with a built-in web application" | ||
authors = ["Logspace <[email protected]>"] | ||
maintainers = [ | ||
|
130 changes: 130 additions & 0 deletions
130
src/backend/base/langflow/alembic/versions/4e5980a44eaa_fix_date_times_again.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
"""Fix date times again | ||
Revision ID: 4e5980a44eaa | ||
Revises: 79e675cb6752 | ||
Create Date: 2024-04-12 18:11:06.454037 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from loguru import logger | ||
from sqlalchemy.dialects import postgresql | ||
from sqlalchemy.engine.reflection import Inspector | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "4e5980a44eaa" | ||
down_revision: Union[str, None] = "79e675cb6752" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
conn = op.get_bind() | ||
inspector = Inspector.from_engine(conn) # type: ignore | ||
table_names = inspector.get_table_names() | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
if "apikey" in table_names: | ||
columns = inspector.get_columns("apikey") | ||
created_at_column = next((column for column in columns if column["name"] == "created_at"), None) | ||
if created_at_column is not None and isinstance(created_at_column["type"], postgresql.TIMESTAMP): | ||
with op.batch_alter_table("apikey", schema=None) as batch_op: | ||
batch_op.alter_column( | ||
"created_at", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=False, | ||
) | ||
else: | ||
if created_at_column is None: | ||
logger.warning("Column 'created_at' not found in table 'apikey'") | ||
else: | ||
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'apikey'") | ||
if "variable" in table_names: | ||
columns = inspector.get_columns("variable") | ||
created_at_column = next((column for column in columns if column["name"] == "created_at"), None) | ||
updated_at_column = next((column for column in columns if column["name"] == "updated_at"), None) | ||
with op.batch_alter_table("variable", schema=None) as batch_op: | ||
if created_at_column is not None and isinstance(created_at_column["type"], postgresql.TIMESTAMP): | ||
batch_op.alter_column( | ||
"created_at", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
else: | ||
if created_at_column is None: | ||
logger.warning("Column 'created_at' not found in table 'variable'") | ||
else: | ||
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'variable'") | ||
if updated_at_column is not None and isinstance(updated_at_column["type"], postgresql.TIMESTAMP): | ||
batch_op.alter_column( | ||
"updated_at", | ||
existing_type=postgresql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=True, | ||
) | ||
else: | ||
if updated_at_column is None: | ||
logger.warning("Column 'updated_at' not found in table 'variable'") | ||
else: | ||
logger.warning(f"Column 'updated_at' has type {updated_at_column['type']} in table 'variable'") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
conn = op.get_bind() | ||
inspector = Inspector.from_engine(conn) # type: ignore | ||
table_names = inspector.get_table_names() | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
if "variable" in table_names: | ||
columns = inspector.get_columns("variable") | ||
created_at_column = next((column for column in columns if column["name"] == "created_at"), None) | ||
updated_at_column = next((column for column in columns if column["name"] == "updated_at"), None) | ||
with op.batch_alter_table("variable", schema=None) as batch_op: | ||
if updated_at_column is not None and isinstance(updated_at_column["type"], sa.DateTime): | ||
batch_op.alter_column( | ||
"updated_at", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
else: | ||
if updated_at_column is None: | ||
logger.warning("Column 'updated_at' not found in table 'variable'") | ||
else: | ||
logger.warning(f"Column 'updated_at' has type {updated_at_column['type']} in table 'variable'") | ||
if created_at_column is not None and isinstance(created_at_column["type"], sa.DateTime): | ||
batch_op.alter_column( | ||
"created_at", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=True, | ||
) | ||
else: | ||
if created_at_column is None: | ||
logger.warning("Column 'created_at' not found in table 'variable'") | ||
else: | ||
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'variable'") | ||
|
||
if "apikey" in table_names: | ||
columns = inspector.get_columns("apikey") | ||
created_at_column = next((column for column in columns if column["name"] == "created_at"), None) | ||
if created_at_column is not None and isinstance(created_at_column["type"], sa.DateTime): | ||
with op.batch_alter_table("apikey", schema=None) as batch_op: | ||
batch_op.alter_column( | ||
"created_at", | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=postgresql.TIMESTAMP(), | ||
existing_nullable=False, | ||
) | ||
else: | ||
if created_at_column is None: | ||
logger.warning("Column 'created_at' not found in table 'apikey'") | ||
else: | ||
logger.warning(f"Column 'created_at' has type {created_at_column['type']} in table 'apikey'") | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.