mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix: mypy
This commit is contained in:
parent
fb00b38fcd
commit
93cf2d4848
3 changed files with 45 additions and 41 deletions
|
|
@ -31,8 +31,8 @@ class FocusLiteLLMDatabase:
|
|||
"""Return usage data for the requested window."""
|
||||
client = self._ensure_prisma_client()
|
||||
|
||||
where_clauses = []
|
||||
query_params = []
|
||||
where_clauses: list[str] = []
|
||||
query_params: list[Any] = []
|
||||
placeholder_index = 1
|
||||
if start_time_utc:
|
||||
where_clauses.append(f"dus.updated_at >= ${placeholder_index}::timestamptz")
|
||||
|
|
|
|||
|
|
@ -61,7 +61,10 @@ class FocusLogger(CustomLogger):
|
|||
else os.getenv("FOCUS_INTERVAL_SECONDS")
|
||||
)
|
||||
self.interval_seconds = int(raw_interval) if raw_interval is not None else None
|
||||
self.prefix = prefix or os.getenv("FOCUS_PREFIX", "focus_exports")
|
||||
env_prefix = os.getenv("FOCUS_PREFIX")
|
||||
self.prefix: str = (
|
||||
prefix if prefix is not None else (env_prefix if env_prefix else "focus_exports")
|
||||
)
|
||||
|
||||
self._destination = FocusDestinationFactory.create(
|
||||
provider=self.provider,
|
||||
|
|
|
|||
|
|
@ -6,44 +6,45 @@ import polars as pl
|
|||
|
||||
# see: https://focus.finops.org/focus-specification/v1-2/
|
||||
FOCUS_NORMALIZED_SCHEMA = pl.Schema(
|
||||
{
|
||||
"BilledCost": pl.Float64,
|
||||
"BillingAccountId": pl.String,
|
||||
"BillingAccountName": pl.String,
|
||||
"BillingCurrency": pl.String,
|
||||
"BillingPeriodStart": pl.Datetime(time_unit="us"),
|
||||
"BillingPeriodEnd": pl.Datetime(time_unit="us"),
|
||||
"ChargeCategory": pl.String,
|
||||
"ChargeClass": pl.String,
|
||||
"ChargeDescription": pl.String,
|
||||
"ChargeFrequency": pl.String,
|
||||
"ChargePeriodStart": pl.Datetime(time_unit="us"),
|
||||
"ChargePeriodEnd": pl.Datetime(time_unit="us"),
|
||||
"ConsumedQuantity": pl.Float64,
|
||||
"ConsumedUnit": pl.Float64,
|
||||
"ContractedCost": pl.Float64,
|
||||
"ContractedUnitPrice": pl.Float64,
|
||||
"EffectiveCost": pl.Float64,
|
||||
"InvoiceIssuerName": pl.String,
|
||||
"ListCost": pl.Float64,
|
||||
"ListUnitPrice": pl.Float64,
|
||||
"PricingCategory": pl.String,
|
||||
"PricingQuantity": pl.Float64,
|
||||
"PricingUnit": pl.String,
|
||||
"ProviderName": pl.String,
|
||||
"PublisherName": pl.String,
|
||||
"RegionId": pl.String,
|
||||
"RegionName": pl.String,
|
||||
"ResourceId": pl.String,
|
||||
"ResourceName": pl.String,
|
||||
"ResourceType": pl.String,
|
||||
"ServiceCategory": pl.String,
|
||||
"ServiceName": pl.String,
|
||||
"SubAccountId": pl.String,
|
||||
"SubAccountName": pl.String,
|
||||
"SubAccountType": pl.String,
|
||||
"Tags": pl.Object,
|
||||
}
|
||||
[
|
||||
("BilledCost", pl.Decimal(18, 6)),
|
||||
("BillingAccountId", pl.String),
|
||||
("BillingAccountName", pl.String),
|
||||
("BillingCurrency", pl.String),
|
||||
("BillingPeriodStart", pl.Datetime(time_unit="us")),
|
||||
("BillingPeriodEnd", pl.Datetime(time_unit="us")),
|
||||
("ChargeCategory", pl.String),
|
||||
("ChargeClass", pl.String),
|
||||
("ChargeDescription", pl.String),
|
||||
("ChargeFrequency", pl.String),
|
||||
("ChargePeriodStart", pl.Datetime(time_unit="us")),
|
||||
("ChargePeriodEnd", pl.Datetime(time_unit="us")),
|
||||
("ConsumedQuantity", pl.Decimal(18, 6)),
|
||||
("ConsumedUnit", pl.String),
|
||||
("ContractedCost", pl.Decimal(18, 6)),
|
||||
("ContractedUnitPrice", pl.Decimal(18, 6)),
|
||||
("EffectiveCost", pl.Decimal(18, 6)),
|
||||
("InvoiceIssuerName", pl.String),
|
||||
("ListCost", pl.Decimal(18, 6)),
|
||||
("ListUnitPrice", pl.Decimal(18, 6)),
|
||||
("PricingCategory", pl.String),
|
||||
("PricingQuantity", pl.Decimal(18, 6)),
|
||||
("PricingUnit", pl.String),
|
||||
("ProviderName", pl.String),
|
||||
("PublisherName", pl.String),
|
||||
("RegionId", pl.String),
|
||||
("RegionName", pl.String),
|
||||
("ResourceId", pl.String),
|
||||
("ResourceName", pl.String),
|
||||
("ResourceType", pl.String),
|
||||
("ServiceCategory", pl.String),
|
||||
("ServiceSubcategory", pl.String),
|
||||
("ServiceName", pl.String),
|
||||
("SubAccountId", pl.String),
|
||||
("SubAccountName", pl.String),
|
||||
("SubAccountType", pl.String),
|
||||
("Tags", pl.Object),
|
||||
]
|
||||
)
|
||||
|
||||
__all__ = ["FOCUS_NORMALIZED_SCHEMA"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue