Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Oct 31, 2024
1 parent afaaf51 commit 2b86670
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions src/palace/manager/marc/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
DiscoveryServiceRegistration,
)
from palace.manager.sqlalchemy.model.edition import Edition
from palace.manager.sqlalchemy.model.identifier import (
Identifier,
RecursiveEquivalencyCache,
)
from palace.manager.sqlalchemy.model.identifier import Identifier
from palace.manager.sqlalchemy.model.integration import (
IntegrationConfiguration,
IntegrationLibraryConfiguration,
Expand Down Expand Up @@ -272,42 +269,6 @@ def query_works(

return session.execute(query).scalars().all()

@staticmethod
def query_isbn_identifiers(
session: Session, identifiers: set[Identifier]
) -> dict[Identifier, Identifier]:
results = {i: i for i in identifiers if i.type == Identifier.ISBN}
needs_lookup = {i.id: i for i in identifiers - results.keys()}
if not needs_lookup:
return results

isbn_query = (
select(RecursiveEquivalencyCache)
.join(
Identifier,
RecursiveEquivalencyCache.identifier_id == Identifier.id,
)
.where(
RecursiveEquivalencyCache.parent_identifier_id.in_(needs_lookup.keys()),
Identifier.type == Identifier.ISBN,
)
.order_by(
RecursiveEquivalencyCache.parent_identifier_id,
RecursiveEquivalencyCache.identifier_id,
)
.options(
selectinload(RecursiveEquivalencyCache.identifier),
)
)
isbn_equivalents = session.execute(isbn_query).scalars().all()

for equivalent in isbn_equivalents:
parent_identifier = needs_lookup[equivalent.parent_identifier_id]
if parent_identifier not in results:
results[parent_identifier] = equivalent.identifier

return results

@staticmethod
def collection(session: Session, collection_id: int) -> Collection | None:
return session.execute(
Expand Down

0 comments on commit 2b86670

Please sign in to comment.