Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone committed Oct 28, 2024
1 parent 7cc28ed commit 4fe7713
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# pylint: disable=unused-argument

from typing import Any, Optional
from warnings import warn

from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.provider.abstract.fetcher import Fetcher
Expand Down Expand Up @@ -76,6 +75,9 @@ class EiaPetroleumStatusReportFetcher(
@staticmethod
def transform_query(params: dict[str, Any]) -> EiaPetroleumStatusReportQueryParams:
"""Transform the query parameters."""
# pylint: disable=import-outside-toplevel
from warnings import warn

category = params.get("category", "balance_sheet")
tables = WpsrTableMap.get(category, {})
_table = params.get("table", "")
Expand Down Expand Up @@ -138,8 +140,9 @@ def transform_data(
import concurrent.futures # noqa
import re
from functools import lru_cache
from warnings import warn
from numpy import nan
from pandas import Categorical, ExcelFile, concat, read_excel
from warnings import warn

category = query.category

Expand Down Expand Up @@ -226,7 +229,9 @@ def read_excel_file(file, category, table):
if len(results) < 1:
raise EmptyDataError("The data is empty.")

results = results.sort_values(by=["date", "table", "order"])
results = results.sort_values(by=["date", "table", "order"]).replace(
{nan: None}
)

return [
EiaPetroleumStatusReportData.model_validate(d)
Expand Down

0 comments on commit 4fe7713

Please sign in to comment.