Skip to content

Commit

Permalink
Updates PyLint workflow and applies recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
AG3NTZ3R0 committed Feb 16, 2024
1 parent ad831b5 commit 8563655
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -20,4 +20,4 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --fail-under=9.0
pylint $(git ls-files '*.py') --fail-under=8.0
4 changes: 2 additions & 2 deletions src/cnbc/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_metadata(api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers).json()
response = requests.request("GET", url, headers=headers, timeout=10).json()

return response

Expand All @@ -38,6 +38,6 @@ def auto_complete(query: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response
2 changes: 1 addition & 1 deletion src/cnbc/market.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def list_indices(api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers).json()
response = requests.request("GET", url, headers=headers, timeout=10).json()

return response
6 changes: 3 additions & 3 deletions src/cnbc/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def list_trending_news(count: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -45,7 +45,7 @@ def list_special_reports(api_key: str, page: str = 1, page_size: str = 25, ):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -72,6 +72,6 @@ def list_symbol_news(symbol: str, api_key: str, page: str = 1, page_size: str =
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response
16 changes: 8 additions & 8 deletions src/cnbc/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_earnings_chart(issue_id: str, num_of_years: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -44,7 +44,7 @@ def get_profile(issue_id: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -69,7 +69,7 @@ def get_chart(issue_id: str, interval: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -92,7 +92,7 @@ def translate(symbol: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -115,7 +115,7 @@ def get_summary(issue_ids: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -138,7 +138,7 @@ def get_fundamentals(issue_ids: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -163,7 +163,7 @@ def get_priceline_chart(issue_id: str, num_of_days: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

Expand All @@ -186,6 +186,6 @@ def get_peers(symbol: str, api_key: str):
'x-rapidapi-key': api_key
}

response = requests.request("GET", url, headers=headers, params=querystring).json()
response = requests.request("GET", url, headers=headers, params=querystring, timeout=10).json()

return response

0 comments on commit 8563655

Please sign in to comment.