cli[patch]: Ignore imports that change the name of the class (#21026)

Not currently handeled by migration script
This commit is contained in:
Eugene Yurtsev
2024-04-29 12:20:30 -04:00
committed by GitHub
parent ce89b34fc0
commit aab78a37f3
3 changed files with 43 additions and 2 deletions

View File

@@ -2123,4 +2123,4 @@
"langchain.vectorstores.singlestoredb.SingleStoreDBRetriever",
"langchain_core.vectorstores.VectorStoreRetriever"
]
]
]

View File

@@ -29,7 +29,17 @@ def _load_migrations_by_file(path: str):
migrations_path = os.path.join(HERE, "migrations", path)
with open(migrations_path, "r", encoding="utf-8") as f:
data = json.load(f)
return data
# new migrations
new_migrations = []
for migration in data:
old = migration[0].split(".")[-1]
new = migration[1].split(".")[-1]
if old == new:
new_migrations.append(migration)
return new_migrations
T = TypeVar("T")