Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions live_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ def _get_document_store():


def get_firestore_client():
"""Return the cloud-agnostic document store (backward-compat alias)."""
return _get_document_store()
"""Return the underlying Firestore client for direct collection/document access.

NOTE: this relies on the GCP provider's ``.client`` property and will
raise AttributeError when the active provider is not GCP.
"""
return _get_document_store().client

def get_state_doc_ref(collection: str = "strategy", document: str = "MULTI_ASSET_STATE"):
"""Return a (collection, document_id) tuple for state storage."""
return collection, document

def get_state_doc_ref(*, collection="strategy", document="MULTI_ASSET_STATE"):
"""Return a Firestore document reference for the given collection/document."""
return get_firestore_client().collection(collection).document(document)


def load_trade_state(*, normalize_fn, default_state_factory, normalize=True, collection="strategy", document="MULTI_ASSET_STATE"):
Expand Down
Loading