Skip to content

Commit a038736

Browse files
committed
imp type hints
1 parent 1536a16 commit a038736

File tree

6 files changed

+66
-2
lines changed

6 files changed

+66
-2
lines changed

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Lint with autopep8
4343
run: |
44-
autopep8 --exit-code --recursive --diff --aggressive ./src
44+
autopep8 --exit-code --recursive --diff --max-line-length 120 ./src
4545
4646
- name: Test with pytest
4747
run: pytest

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"github.vscode-github-actions",
4+
"ms-python.autopep8",
5+
"ms-python.vscode-pylance",
6+
"ms-python.python"
7+
]
8+
}

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"justMyCode": true
14+
}
15+
]
16+
}

.vscode/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"files.autoSave": "onFocusChange",
3+
"files.trimTrailingWhitespace": true,
4+
"files.insertFinalNewline": true,
5+
"terminal.integrated.fontSize": 15,
6+
"python.terminal.activateEnvironment": true,
7+
"python.testing.unittestEnabled": false,
8+
"python.testing.pytestEnabled": true,
9+
"python.testing.pytestArgs": [
10+
"tests"
11+
],
12+
"python.analysis.typeCheckingMode": "standard",
13+
"python.analysis.extraPaths": [
14+
"./src"
15+
],
16+
"[python]": {
17+
"editor.formatOnSave": true,
18+
"editor.defaultFormatter": "ms-python.autopep8"
19+
},
20+
"autopep8.args": [
21+
"--max-line-length=100"
22+
],
23+
"pylint.args": [
24+
"--max-line-length=100"
25+
],
26+
"pylint.severity": {
27+
"convention": "Information",
28+
"error": "Error",
29+
"fatal": "Error",
30+
"refactor": "Hint",
31+
"warning": "Warning",
32+
"info": "Information"
33+
}
34+
}

mac/app_settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
3+
"AzureWebJobsDisableHomepage": true,
4+
"AzureFunctionsJobHost__extensions__http__routePrefix" : ""
5+
}

src/calc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"""
55
from datetime import date
66
from json import dump
7+
from typing import Union
78
from pandas import DataFrame, to_datetime, to_datetime
89
from log import logger
910
from requests import get
1011

1112

12-
def download_data(ticker: str) -> tuple[bool, dict | str]:
13+
def download_data(ticker: str) -> tuple[bool, Union[dict, str]]:
1314
"""
1415
Download historic data for a given stock ticker symbol from Nasdaq.com.
1516
Details about it: https://www.nasdaq.com/market-activity/quotes/historical

0 commit comments

Comments
 (0)