Skip to content

Commit

Permalink
feature: excessive logs remove
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanildoBarauna committed Sep 25, 2024
1 parent 378ba5d commit ee8f3ad
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .idea/api-to-dataframe.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/poetry.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "api-to-dataframe"
version = "1.3.10"
version = "1.3.11"
description = "A package to convert API responses to pandas dataframe"
authors = ["IvanildoBarauna <[email protected]>"]
readme = "README.md"
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions src/api_to_dataframe/controller/client_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class ClientBuilder:
def __init__( # pylint: disable=too-many-arguments
def __init__( # pylint: disable=too-many-positional-arguments,too-many-arguments
self,
endpoint: str,
headers: dict = None,
Expand Down Expand Up @@ -89,5 +89,4 @@ def api_to_dataframe(response: dict):
DataFrame: A pandas DataFrame containing the data from the API response.
"""
df = GetData.to_dataframe(response)
log("serialized to dataframe: OK", LogLevel.INFO)
return df
1 change: 0 additions & 1 deletion src/api_to_dataframe/models/get_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class GetData:
def get_response(endpoint: str, headers: dict, connection_timeout: int):
response = requests.get(endpoint, timeout=connection_timeout, headers=headers)
response.raise_for_status()
log("get_response: ok", LogLevel.INFO)
return response

@staticmethod
Expand Down
11 changes: 6 additions & 5 deletions src/api_to_dataframe/models/retainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ def wrapper(*args, **kwargs): # pylint: disable=inconsistent-return-statements
retry_number = 0
while retry_number < args[0].retries:
try:
log(
f"Trying for the {retry_number} of {Constants.MAX_OF_RETRIES} retries. "
f"Using {args[0].retry_strategy}",
LogLevel.INFO,
)
if retry_number > 0:
log(
f"Trying for the {retry_number} of {Constants.MAX_OF_RETRIES} retries. "
f"Using {args[0].retry_strategy}",
LogLevel.INFO,
)
return func(*args, **kwargs)
except RequestException as e:
retry_number += 1
Expand Down

0 comments on commit ee8f3ad

Please sign in to comment.